Statistics
| Branch: | Revision:

root / quad2 / arduino / src / ros_lib / sensor_msgs / NavSatStatus.h @ c1426757

History | View | Annotate | Download (1.79 KB)

1
#ifndef _ROS_sensor_msgs_NavSatStatus_h
2
#define _ROS_sensor_msgs_NavSatStatus_h
3

    
4
#include <stdint.h>
5
#include <string.h>
6
#include <stdlib.h>
7
#include "ros/msg.h"
8

    
9
namespace sensor_msgs
10
{
11

    
12
  class NavSatStatus : public ros::Msg
13
  {
14
    public:
15
      int8_t status;
16
      uint16_t service;
17
      enum { STATUS_NO_FIX =   -1         };
18
      enum { STATUS_FIX =       0         };
19
      enum { STATUS_SBAS_FIX =  1         };
20
      enum { STATUS_GBAS_FIX =  2         };
21
      enum { SERVICE_GPS =      1 };
22
      enum { SERVICE_GLONASS =  2 };
23
      enum { SERVICE_COMPASS =  4       };
24
      enum { SERVICE_GALILEO =  8 };
25

    
26
    virtual int serialize(unsigned char *outbuffer) const
27
    {
28
      int offset = 0;
29
      union {
30
        int8_t real;
31
        uint8_t base;
32
      } u_status;
33
      u_status.real = this->status;
34
      *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF;
35
      offset += sizeof(this->status);
36
      *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF;
37
      *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF;
38
      offset += sizeof(this->service);
39
      return offset;
40
    }
41

    
42
    virtual int deserialize(unsigned char *inbuffer)
43
    {
44
      int offset = 0;
45
      union {
46
        int8_t real;
47
        uint8_t base;
48
      } u_status;
49
      u_status.base = 0;
50
      u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
51
      this->status = u_status.real;
52
      offset += sizeof(this->status);
53
      this->service |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
54
      this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
55
      offset += sizeof(this->service);
56
     return offset;
57
    }
58

    
59
    const char * getType(){ return "sensor_msgs/NavSatStatus"; };
60
    const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; };
61

    
62
  };
63

    
64
}
65
#endif