root / quad2 / arduino / src / ros_lib / std_msgs / UInt16.h @ c1426757
History | View | Annotate | Download (953 Bytes)
1 | c1426757 | Tom Mullins | #ifndef _ROS_std_msgs_UInt16_h
|
---|---|---|---|
2 | #define _ROS_std_msgs_UInt16_h
|
||
3 | |||
4 | #include <stdint.h> |
||
5 | #include <string.h> |
||
6 | #include <stdlib.h> |
||
7 | #include "ros/msg.h" |
||
8 | |||
9 | namespace std_msgs |
||
10 | { |
||
11 | |||
12 | class UInt16 : public ros::Msg |
||
13 | { |
||
14 | public:
|
||
15 | uint16_t data; |
||
16 | |||
17 | virtual int serialize(unsigned char *outbuffer) const |
||
18 | { |
||
19 | int offset = 0; |
||
20 | *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; |
||
21 | *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; |
||
22 | offset += sizeof(this->data);
|
||
23 | return offset;
|
||
24 | } |
||
25 | |||
26 | virtual int deserialize(unsigned char *inbuffer) |
||
27 | { |
||
28 | int offset = 0; |
||
29 | this->data |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); |
||
30 | this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); |
||
31 | offset += sizeof(this->data);
|
||
32 | return offset;
|
||
33 | } |
||
34 | |||
35 | const char * getType(){ return "std_msgs/UInt16"; }; |
||
36 | const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; |
||
37 | |||
38 | }; |
||
39 | |||
40 | } |
||
41 | #endif |