UInt8MultiArray.h
Go to the documentation of this file.
00001 #ifndef _ROS_std_msgs_UInt8MultiArray_h
00002 #define _ROS_std_msgs_UInt8MultiArray_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/MultiArrayLayout.h"
00009 
00010 namespace std_msgs
00011 {
00012 
00013   class UInt8MultiArray : public ros::Msg
00014   {
00015     public:
00016       std_msgs::MultiArrayLayout layout;
00017       uint8_t data_length;
00018       uint8_t st_data;
00019       uint8_t * data;
00020 
00021     virtual int serialize(unsigned char *outbuffer) const
00022     {
00023       int offset = 0;
00024       offset += this->layout.serialize(outbuffer + offset);
00025       *(outbuffer + offset++) = data_length;
00026       *(outbuffer + offset++) = 0;
00027       *(outbuffer + offset++) = 0;
00028       *(outbuffer + offset++) = 0;
00029       for( uint8_t i = 0; i < data_length; i++){
00030       *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF;
00031       offset += sizeof(this->data[i]);
00032       }
00033       return offset;
00034     }
00035 
00036     virtual int deserialize(unsigned char *inbuffer)
00037     {
00038       int offset = 0;
00039       offset += this->layout.deserialize(inbuffer + offset);
00040       uint8_t data_lengthT = *(inbuffer + offset++);
00041       if(data_lengthT > data_length)
00042         this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t));
00043       offset += 3;
00044       data_length = data_lengthT;
00045       for( uint8_t i = 0; i < data_length; i++){
00046       this->st_data =  ((uint8_t) (*(inbuffer + offset)));
00047       offset += sizeof(this->st_data);
00048         memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t));
00049       }
00050      return offset;
00051     }
00052 
00053     const char * getType(){ return "std_msgs/UInt8MultiArray"; };
00054     const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; };
00055 
00056   };
00057 
00058 }
00059 #endif


lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:23