This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial. This program contains an example.
Dependencies: rosserial_mbed_lib mbed Servo
Diff: sensor_msgs/NavSatStatus.h
- Revision:
- 3:dff241b66f84
- Parent:
- 0:06fc856e99ca
--- a/sensor_msgs/NavSatStatus.h Sun Oct 16 09:33:53 2011 +0000 +++ b/sensor_msgs/NavSatStatus.h Sat Nov 12 23:53:04 2011 +0000 @@ -1,10 +1,10 @@ -#ifndef ros_NavSatStatus_h -#define ros_NavSatStatus_h +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h #include <stdint.h> #include <string.h> #include <stdlib.h> -#include "../ros/msg.h" +#include "ros/msg.h" namespace sensor_msgs { @@ -12,34 +12,29 @@ class NavSatStatus : public ros::Msg { public: - signed char status; - unsigned short service; - enum { STATUS_NO_FIX = -1 }; - enum { STATUS_FIX = 0 }; - enum { STATUS_SBAS_FIX = 1 }; - enum { STATUS_GBAS_FIX = 2 }; - enum { SERVICE_GPS = 1 }; - enum { SERVICE_GLONASS = 2 }; - enum { SERVICE_COMPASS = 4 }; - enum { SERVICE_GALILEO = 8 }; + int8_t status; + uint16_t service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; - virtual int serialize(unsigned char *outbuffer) + virtual int serialize(unsigned char *outbuffer) const { int offset = 0; union { - signed char real; - unsigned char base; + int8_t real; + uint8_t base; } u_status; u_status.real = this->status; *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; offset += sizeof(this->status); - union { - unsigned short real; - unsigned short base; - } u_service; - u_service.real = this->service; - *(outbuffer + offset + 0) = (u_service.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_service.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; offset += sizeof(this->service); return offset; } @@ -48,26 +43,21 @@ { int offset = 0; union { - signed char real; - unsigned char base; + int8_t real; + uint8_t base; } u_status; u_status.base = 0; - u_status.base |= ((typeof(u_status.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); this->status = u_status.real; offset += sizeof(this->status); - union { - unsigned short real; - unsigned short base; - } u_service; - u_service.base = 0; - u_service.base |= ((typeof(u_service.base)) (*(inbuffer + offset + 0))) << (8 * 0); - u_service.base |= ((typeof(u_service.base)) (*(inbuffer + offset + 1))) << (8 * 1); - this->service = u_service.real; + this->service |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); offset += sizeof(this->service); return offset; } - virtual const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + virtual const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + virtual const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; };