rosserial for Hydro

Dependencies:   MODSERIAL

Fork of rosserial_mbed_lib by nucho

Committer:
isad
Date:
Thu May 08 06:34:18 2014 +0000
Revision:
5:c30c76e8c3f1
Parent:
4:684f39d0c346
rosserial_mbed for ROS hydro

Who changed what in which revision?

UserRevisionLine numberNew contents of line
isad 5:c30c76e8c3f1 1 #ifndef _ROS_std_msgs_UInt8_h
nucho 3:1cf99502f396 2 #define _ROS_std_msgs_UInt8_h
nucho 3:1cf99502f396 3
nucho 3:1cf99502f396 4 #include <stdint.h>
nucho 3:1cf99502f396 5 #include <string.h>
nucho 3:1cf99502f396 6 #include <stdlib.h>
nucho 3:1cf99502f396 7 #include "ros/msg.h"
nucho 3:1cf99502f396 8
nucho 3:1cf99502f396 9 namespace std_msgs
nucho 3:1cf99502f396 10 {
nucho 3:1cf99502f396 11
nucho 3:1cf99502f396 12 class UInt8 : public ros::Msg
nucho 3:1cf99502f396 13 {
nucho 3:1cf99502f396 14 public:
nucho 3:1cf99502f396 15 uint8_t data;
nucho 3:1cf99502f396 16
nucho 3:1cf99502f396 17 virtual int serialize(unsigned char *outbuffer) const
nucho 3:1cf99502f396 18 {
nucho 3:1cf99502f396 19 int offset = 0;
nucho 3:1cf99502f396 20 *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF;
nucho 3:1cf99502f396 21 offset += sizeof(this->data);
nucho 3:1cf99502f396 22 return offset;
nucho 3:1cf99502f396 23 }
nucho 3:1cf99502f396 24
nucho 3:1cf99502f396 25 virtual int deserialize(unsigned char *inbuffer)
nucho 3:1cf99502f396 26 {
nucho 3:1cf99502f396 27 int offset = 0;
nucho 4:684f39d0c346 28 this->data = ((uint8_t) (*(inbuffer + offset)));
nucho 3:1cf99502f396 29 offset += sizeof(this->data);
nucho 3:1cf99502f396 30 return offset;
nucho 3:1cf99502f396 31 }
nucho 3:1cf99502f396 32
isad 5:c30c76e8c3f1 33 const char * getType(){ return "std_msgs/UInt8"; };
isad 5:c30c76e8c3f1 34 const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; };
nucho 3:1cf99502f396 35
nucho 3:1cf99502f396 36 };
nucho 3:1cf99502f396 37
nucho 3:1cf99502f396 38 }
nucho 0:77afd7560544 39 #endif