Project

General

Profile

Statistics
| Branch: | Revision:

root / quad2 / arduino / src / ros_lib / std_msgs / Bool.h @ c1426757

History | View | Annotate | Download (1.01 KB)

1 c1426757 Tom Mullins
#ifndef _ROS_std_msgs_Bool_h
2
#define _ROS_std_msgs_Bool_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 Bool : public ros::Msg
13
  {
14
    public:
15
      bool data;
16
17
    virtual int serialize(unsigned char *outbuffer) const
18
    {
19
      int offset = 0;
20
      union {
21
        bool 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
        bool 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/Bool"; };
45
    const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; };
46
47
  };
48
49
}
50
#endif