kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Byte.h
Go to the documentation of this file.
1 #ifndef _ROS_std_msgs_Byte_h
2 #define _ROS_std_msgs_Byte_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 Byte : public ros::Msg
13  {
14  public:
15  int8_t data;
16 
17  Byte():
18  data(0)
19  {
20  }
21 
22  virtual int serialize(unsigned char *outbuffer) const
23  {
24  int offset = 0;
25  union {
26  int8_t real;
27  uint8_t base;
28  } u_data;
29  u_data.real = this->data;
30  *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
31  offset += sizeof(this->data);
32  return offset;
33  }
34 
35  virtual int deserialize(unsigned char *inbuffer)
36  {
37  int offset = 0;
38  union {
39  int8_t real;
40  uint8_t base;
41  } u_data;
42  u_data.base = 0;
43  u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
44  this->data = u_data.real;
45  offset += sizeof(this->data);
46  return offset;
47  }
48 
49  const char * getType(){ return "std_msgs/Byte"; };
50  const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; };
51 
52  };
53 
54 }
55 #endif
virtual int deserialize(unsigned char *inbuffer)
Definition: Byte.h:35
const char * getType()
Definition: Byte.h:49
int8_t data
Definition: Byte.h:15
const char * getMD5()
Definition: Byte.h:50
Definition: Byte.h:12
Byte()
Definition: Byte.h:17
virtual int serialize(unsigned char *outbuffer) const
Definition: Byte.h:22
Definition: msg.h:43