ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NavSatStatus.h Source File

NavSatStatus.h

00001 #ifndef _ROS_sensor_msgs_NavSatStatus_h
00002 #define _ROS_sensor_msgs_NavSatStatus_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace sensor_msgs
00010 {
00011 
00012   class NavSatStatus : public ros::Msg
00013   {
00014     public:
00015       int8_t status;
00016       uint16_t service;
00017       enum { STATUS_NO_FIX =   -1         };
00018       enum { STATUS_FIX =       0         };
00019       enum { STATUS_SBAS_FIX =  1         };
00020       enum { STATUS_GBAS_FIX =  2         };
00021       enum { SERVICE_GPS =      1 };
00022       enum { SERVICE_GLONASS =  2 };
00023       enum { SERVICE_COMPASS =  4       };
00024       enum { SERVICE_GALILEO =  8 };
00025 
00026     NavSatStatus():
00027       status(0),
00028       service(0)
00029     {
00030     }
00031 
00032     virtual int serialize(unsigned char *outbuffer) const
00033     {
00034       int offset = 0;
00035       union {
00036         int8_t real;
00037         uint8_t base;
00038       } u_status;
00039       u_status.real = this->status;
00040       *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF;
00041       offset += sizeof(this->status);
00042       *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF;
00043       *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF;
00044       offset += sizeof(this->service);
00045       return offset;
00046     }
00047 
00048     virtual int deserialize(unsigned char *inbuffer)
00049     {
00050       int offset = 0;
00051       union {
00052         int8_t real;
00053         uint8_t base;
00054       } u_status;
00055       u_status.base = 0;
00056       u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00057       this->status = u_status.real;
00058       offset += sizeof(this->status);
00059       this->service =  ((uint16_t) (*(inbuffer + offset)));
00060       this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00061       offset += sizeof(this->service);
00062      return offset;
00063     }
00064 
00065     const char * getType(){ return "sensor_msgs/NavSatStatus"; };
00066     const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; };
00067 
00068   };
00069 
00070 }
00071 #endif