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


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