root / quad2 / arduino / src / ros_lib / rosgraph_msgs / Clock.h @ c1426757
History | View | Annotate | Download (1.96 KB)
1 | c1426757 | Tom Mullins | #ifndef _ROS_rosgraph_msgs_Clock_h
|
---|---|---|---|
2 | #define _ROS_rosgraph_msgs_Clock_h
|
||
3 | |||
4 | #include <stdint.h> |
||
5 | #include <string.h> |
||
6 | #include <stdlib.h> |
||
7 | #include "ros/msg.h" |
||
8 | #include "ros/time.h" |
||
9 | |||
10 | namespace rosgraph_msgs |
||
11 | { |
||
12 | |||
13 | class Clock : public ros::Msg |
||
14 | { |
||
15 | public:
|
||
16 | ros::Time clock; |
||
17 | |||
18 | virtual int serialize(unsigned char *outbuffer) const |
||
19 | { |
||
20 | int offset = 0; |
||
21 | *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; |
||
22 | *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; |
||
23 | *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; |
||
24 | *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; |
||
25 | offset += sizeof(this->clock.sec);
|
||
26 | *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; |
||
27 | *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; |
||
28 | *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; |
||
29 | *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; |
||
30 | offset += sizeof(this->clock.nsec);
|
||
31 | return offset;
|
||
32 | } |
||
33 | |||
34 | virtual int deserialize(unsigned char *inbuffer) |
||
35 | { |
||
36 | int offset = 0; |
||
37 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
||
38 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
||
39 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
||
40 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
||
41 | offset += sizeof(this->clock.sec);
|
||
42 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
||
43 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
||
44 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
||
45 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
||
46 | offset += sizeof(this->clock.nsec);
|
||
47 | return offset;
|
||
48 | } |
||
49 | |||
50 | const char * getType(){ return "rosgraph_msgs/Clock"; }; |
||
51 | const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; |
||
52 | |||
53 | }; |
||
54 | |||
55 | } |
||
56 | #endif |