Project

General

Profile

Statistics
| Branch: | Revision:

root / scout_avr / src / ros_lib / std_msgs / UInt32.h @ 88fb3a79

History | View | Annotate | Download (1.2 KB)

1
#ifndef _ROS_std_msgs_UInt32_h
2
#define _ROS_std_msgs_UInt32_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 UInt32 : public ros::Msg
13
  {
14
    public:
15
      uint32_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
      *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF;
23
      *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF;
24
      offset += sizeof(this->data);
25
      return offset;
26
    }
27

    
28
    virtual int deserialize(unsigned char *inbuffer)
29
    {
30
      int offset = 0;
31
      this->data |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
32
      this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
33
      this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
34
      this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
35
      offset += sizeof(this->data);
36
     return offset;
37
    }
38

    
39
    const char * getType(){ return "std_msgs/UInt32"; };
40
    const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; };
41

    
42
  };
43

    
44
}
45
#endif