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 TwoIntsResult.h Source File

TwoIntsResult.h

00001 #ifndef _ROS_actionlib_TwoIntsResult_h
00002 #define _ROS_actionlib_TwoIntsResult_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace actionlib
00010 {
00011 
00012   class TwoIntsResult : public ros::Msg
00013   {
00014     public:
00015       int64_t sum;
00016 
00017     TwoIntsResult():
00018       sum(0)
00019     {
00020     }
00021 
00022     virtual int serialize(unsigned char *outbuffer) const
00023     {
00024       int offset = 0;
00025       union {
00026         int64_t real;
00027         uint64_t base;
00028       } u_sum;
00029       u_sum.real = this->sum;
00030       *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF;
00031       *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF;
00032       *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF;
00033       *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF;
00034       *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF;
00035       *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF;
00036       *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF;
00037       *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF;
00038       offset += sizeof(this->sum);
00039       return offset;
00040     }
00041 
00042     virtual int deserialize(unsigned char *inbuffer)
00043     {
00044       int offset = 0;
00045       union {
00046         int64_t real;
00047         uint64_t base;
00048       } u_sum;
00049       u_sum.base = 0;
00050       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00051       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00052       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00053       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00054       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00055       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00056       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00057       u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00058       this->sum = u_sum.real;
00059       offset += sizeof(this->sum);
00060      return offset;
00061     }
00062 
00063     const char * getType(){ return "actionlib/TwoIntsResult"; };
00064     const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; };
00065 
00066   };
00067 
00068 }
00069 #endif