Go to the documentation of this file.00001 #ifndef _ROS_rosserial_msgs_Log_h
00002 #define _ROS_rosserial_msgs_Log_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008
00009 namespace rosserial_msgs
00010 {
00011
00012 class Log : public ros::Msg
00013 {
00014 public:
00015 uint8_t level;
00016 const char* msg;
00017 enum { ROSDEBUG = 0 };
00018 enum { INFO = 1 };
00019 enum { WARN = 2 };
00020 enum { ERROR = 3 };
00021 enum { FATAL = 4 };
00022
00023 virtual int serialize(unsigned char *outbuffer) const
00024 {
00025 int offset = 0;
00026 *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF;
00027 offset += sizeof(this->level);
00028 uint32_t length_msg = strlen(this->msg);
00029 memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t));
00030 offset += 4;
00031 memcpy(outbuffer + offset, this->msg, length_msg);
00032 offset += length_msg;
00033 return offset;
00034 }
00035
00036 virtual int deserialize(unsigned char *inbuffer)
00037 {
00038 int offset = 0;
00039 this->level = ((uint8_t) (*(inbuffer + offset)));
00040 offset += sizeof(this->level);
00041 uint32_t length_msg;
00042 memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t));
00043 offset += 4;
00044 for(unsigned int k= offset; k< offset+length_msg; ++k){
00045 inbuffer[k-1]=inbuffer[k];
00046 }
00047 inbuffer[offset+length_msg-1]=0;
00048 this->msg = (char *)(inbuffer + offset-1);
00049 offset += length_msg;
00050 return offset;
00051 }
00052
00053 const char * getType(){ return "rosserial_msgs/Log"; };
00054 const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; };
00055
00056 };
00057
00058 }
00059 #endif