apm_adc.h
Go to the documentation of this file.
00001 #ifndef _ROS_komodo_sensors_apm_adc_h
00002 #define _ROS_komodo_sensors_apm_adc_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace komodo_sensors
00010 {
00011 
00012   class apm_adc : public ros::Msg
00013   {
00014     public:
00015       uint16_t A0;
00016       uint16_t A1;
00017       uint16_t A2;
00018       uint16_t A3;
00019       uint16_t A4;
00020       uint16_t A5;
00021       uint16_t A6;
00022       uint16_t A7;
00023 
00024     virtual int serialize(unsigned char *outbuffer) const
00025     {
00026       int offset = 0;
00027       *(outbuffer + offset + 0) = (this->A0 >> (8 * 0)) & 0xFF;
00028       *(outbuffer + offset + 1) = (this->A0 >> (8 * 1)) & 0xFF;
00029       offset += sizeof(this->A0);
00030       *(outbuffer + offset + 0) = (this->A1 >> (8 * 0)) & 0xFF;
00031       *(outbuffer + offset + 1) = (this->A1 >> (8 * 1)) & 0xFF;
00032       offset += sizeof(this->A1);
00033       *(outbuffer + offset + 0) = (this->A2 >> (8 * 0)) & 0xFF;
00034       *(outbuffer + offset + 1) = (this->A2 >> (8 * 1)) & 0xFF;
00035       offset += sizeof(this->A2);
00036       *(outbuffer + offset + 0) = (this->A3 >> (8 * 0)) & 0xFF;
00037       *(outbuffer + offset + 1) = (this->A3 >> (8 * 1)) & 0xFF;
00038       offset += sizeof(this->A3);
00039       *(outbuffer + offset + 0) = (this->A4 >> (8 * 0)) & 0xFF;
00040       *(outbuffer + offset + 1) = (this->A4 >> (8 * 1)) & 0xFF;
00041       offset += sizeof(this->A4);
00042       *(outbuffer + offset + 0) = (this->A5 >> (8 * 0)) & 0xFF;
00043       *(outbuffer + offset + 1) = (this->A5 >> (8 * 1)) & 0xFF;
00044       offset += sizeof(this->A5);
00045       *(outbuffer + offset + 0) = (this->A6 >> (8 * 0)) & 0xFF;
00046       *(outbuffer + offset + 1) = (this->A6 >> (8 * 1)) & 0xFF;
00047       offset += sizeof(this->A6);
00048       *(outbuffer + offset + 0) = (this->A7 >> (8 * 0)) & 0xFF;
00049       *(outbuffer + offset + 1) = (this->A7 >> (8 * 1)) & 0xFF;
00050       offset += sizeof(this->A7);
00051       return offset;
00052     }
00053 
00054     virtual int deserialize(unsigned char *inbuffer)
00055     {
00056       int offset = 0;
00057       this->A0 =  ((uint16_t) (*(inbuffer + offset)));
00058       this->A0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00059       offset += sizeof(this->A0);
00060       this->A1 =  ((uint16_t) (*(inbuffer + offset)));
00061       this->A1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00062       offset += sizeof(this->A1);
00063       this->A2 =  ((uint16_t) (*(inbuffer + offset)));
00064       this->A2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00065       offset += sizeof(this->A2);
00066       this->A3 =  ((uint16_t) (*(inbuffer + offset)));
00067       this->A3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00068       offset += sizeof(this->A3);
00069       this->A4 =  ((uint16_t) (*(inbuffer + offset)));
00070       this->A4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00071       offset += sizeof(this->A4);
00072       this->A5 =  ((uint16_t) (*(inbuffer + offset)));
00073       this->A5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00074       offset += sizeof(this->A5);
00075       this->A6 =  ((uint16_t) (*(inbuffer + offset)));
00076       this->A6 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00077       offset += sizeof(this->A6);
00078       this->A7 =  ((uint16_t) (*(inbuffer + offset)));
00079       this->A7 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
00080       offset += sizeof(this->A7);
00081      return offset;
00082     }
00083 
00084     const char * getType(){ return "komodo_sensors/apm_adc"; };
00085     const char * getMD5(){ return "5d009541046908a1e7a9f62e0bb7a56e"; };
00086 
00087   };
00088 
00089 }
00090 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:54