root / quad2 / arduino / src / ros_lib / std_msgs / Int8.h @ c1426757
History | View | Annotate | Download (1.01 KB)
1 | c1426757 | Tom Mullins | #ifndef _ROS_std_msgs_Int8_h
|
---|---|---|---|
2 | #define _ROS_std_msgs_Int8_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 Int8 : public ros::Msg |
||
13 | { |
||
14 | public:
|
||
15 | int8_t data; |
||
16 | |||
17 | virtual int serialize(unsigned char *outbuffer) const |
||
18 | { |
||
19 | int offset = 0; |
||
20 | union {
|
||
21 | int8_t real; |
||
22 | uint8_t base; |
||
23 | } u_data; |
||
24 | u_data.real = this->data; |
||
25 | *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; |
||
26 | offset += sizeof(this->data);
|
||
27 | return offset;
|
||
28 | } |
||
29 | |||
30 | virtual int deserialize(unsigned char *inbuffer) |
||
31 | { |
||
32 | int offset = 0; |
||
33 | union {
|
||
34 | int8_t real; |
||
35 | uint8_t base; |
||
36 | } u_data; |
||
37 | u_data.base = 0;
|
||
38 | u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
||
39 | this->data = u_data.real; |
||
40 | offset += sizeof(this->data);
|
||
41 | return offset;
|
||
42 | } |
||
43 | |||
44 | const char * getType(){ return "std_msgs/Int8"; }; |
||
45 | const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; |
||
46 | |||
47 | }; |
||
48 | |||
49 | } |
||
50 | #endif |