00001 #ifndef _ROS_SERVICE_SetLoggerLevel_h 00002 #define _ROS_SERVICE_SetLoggerLevel_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 00008 namespace roscpp 00009 { 00010 00011 static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; 00012 00013 class SetLoggerLevelRequest : public ros::Msg 00014 { 00015 public: 00016 char * logger; 00017 char * level; 00018 00019 virtual int serialize(unsigned char *outbuffer) const 00020 { 00021 int offset = 0; 00022 uint32_t * length_logger = (uint32_t *)(outbuffer + offset); 00023 *length_logger = strlen( (const char*) this->logger); 00024 offset += 4; 00025 memcpy(outbuffer + offset, this->logger, *length_logger); 00026 offset += *length_logger; 00027 uint32_t * length_level = (uint32_t *)(outbuffer + offset); 00028 *length_level = strlen( (const char*) this->level); 00029 offset += 4; 00030 memcpy(outbuffer + offset, this->level, *length_level); 00031 offset += *length_level; 00032 return offset; 00033 } 00034 00035 virtual int deserialize(unsigned char *inbuffer) 00036 { 00037 int offset = 0; 00038 uint32_t length_logger = *(uint32_t *)(inbuffer + offset); 00039 offset += 4; 00040 for(unsigned int k= offset; k< offset+length_logger; ++k){ 00041 inbuffer[k-1]=inbuffer[k]; 00042 } 00043 inbuffer[offset+length_logger-1]=0; 00044 this->logger = (char *)(inbuffer + offset-1); 00045 offset += length_logger; 00046 uint32_t length_level = *(uint32_t *)(inbuffer + offset); 00047 offset += 4; 00048 for(unsigned int k= offset; k< offset+length_level; ++k){ 00049 inbuffer[k-1]=inbuffer[k]; 00050 } 00051 inbuffer[offset+length_level-1]=0; 00052 this->level = (char *)(inbuffer + offset-1); 00053 offset += length_level; 00054 return offset; 00055 } 00056 00057 const char * getType(){ return SETLOGGERLEVEL; }; 00058 const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; 00059 00060 }; 00061 00062 class SetLoggerLevelResponse : public ros::Msg 00063 { 00064 public: 00065 00066 virtual int serialize(unsigned char *outbuffer) const 00067 { 00068 int offset = 0; 00069 return offset; 00070 } 00071 00072 virtual int deserialize(unsigned char *inbuffer) 00073 { 00074 int offset = 0; 00075 return offset; 00076 } 00077 00078 const char * getType(){ return SETLOGGERLEVEL; }; 00079 const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; 00080 00081 }; 00082 00083 class SetLoggerLevel { 00084 public: 00085 typedef SetLoggerLevelRequest Request; 00086 typedef SetLoggerLevelResponse Response; 00087 }; 00088 00089 } 00090 #endif