SickLDUtility.hh
Go to the documentation of this file.
1 
16 /* Auto-generated header */
17 #include "SickConfig.hh"
18 
23 #define REVERSE_BYTE_ORDER_16( y ) ( ( ( y & 0x00FF ) << 8 ) | ( ( y & 0xFF00 ) >> 8 ) )
24 
29 #define REVERSE_BYTE_ORDER_32( y ) ( ( ( y & 0x000000FF ) << 24 ) | ( ( y & 0x0000FF00 ) << 8 ) | ( ( y & 0x00FF0000 ) >> 8 ) | ( ( y & 0xFF000000 ) >> 24 ) )
30 
31 /* Associate the namespace */
32 namespace SickToolbox {
33 
34 #ifndef WORDS_BIGENDIAN
35 
36 /* NOTE: The following functions are necessary since the Sick LD doesn't adopt the
37  * convention of converting from network byte order.
38  */
39 
45 inline uint16_t host_to_sick_ld_byte_order( uint16_t value ) {
46  return REVERSE_BYTE_ORDER_16(value);
47 }
48 
54 inline uint32_t host_to_sick_ld_byte_order( uint32_t value ) {
55  return REVERSE_BYTE_ORDER_32(value);
56 }
57 
63 inline uint16_t sick_ld_to_host_byte_order( uint16_t value ) {
64  return REVERSE_BYTE_ORDER_16(value);
65 }
66 
72 inline uint32_t sick_ld_to_host_byte_order( uint32_t value ) {
73  return REVERSE_BYTE_ORDER_32(value);
74 }
75 
76 #else // The host has a big-endian architecture
77 
83 inline uint16_t host_to_sick_ld_byte_order( uint16_t value ) {
84  return value;
85 }
86 
92 inline uint32_t host_to_sick_ld_byte_order( uint32_t value ) {
93  return value;
94 }
95 
101 inline uint16_t sick_ld_to_host_byte_order( uint16_t value ) {
102  return value;
103 }
104 
110 inline uint32_t sick_ld_to_host_byte_order( uint32_t value ) {
111  return value;
112 }
113 
114 #endif /* _LITTLE_ENDIAN_HOST */
115 
116 /*
117  * NOTE: Other utility functions can be defined here
118  */
119 
120 } //namespace SickToolbox
#define REVERSE_BYTE_ORDER_32(y)
Reverses the byte order of the given 32 bit unsigned integer.
uint16_t sick_ld_to_host_byte_order(uint16_t value)
Converts Sick LD byte order (big-endian) to host byte order (little-endian)
#define REVERSE_BYTE_ORDER_16(y)
Reverses the byte order of the given 16 bit unsigned integer.
Encapsulates the Sick LIDAR Matlab/C++ toolbox.
Definition: SickLD.cc:44
uint16_t host_to_sick_ld_byte_order(uint16_t value)
Converts host byte order (little-endian) to Sick LD byte order (big-endian)


sicktoolbox
Author(s): Jason Derenick , Thomas Miller
autogenerated on Tue Sep 10 2019 03:37:34