![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial. This program contains an example.
Dependencies: rosserial_mbed_lib mbed Servo
Diff: roscpp/SetLoggerLevel.h
- Revision:
- 3:dff241b66f84
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/roscpp/SetLoggerLevel.h Sat Nov 12 23:53:04 2011 +0000 @@ -0,0 +1,90 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include <stdint.h> +#include <string.h> +#include <stdlib.h> +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + char * logger; + char * level; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t * length_logger = (uint32_t *)(outbuffer + offset); + *length_logger = strlen( (const char*) this->logger); + offset += 4; + memcpy(outbuffer + offset, this->logger, *length_logger); + offset += *length_logger; + uint32_t * length_level = (uint32_t *)(outbuffer + offset); + *length_level = strlen( (const char*) this->level); + offset += 4; + memcpy(outbuffer + offset, this->level, *length_level); + offset += *length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger = *(uint32_t *)(inbuffer + offset); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level = *(uint32_t *)(inbuffer + offset); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + virtual const char * getType(){ return SETLOGGERLEVEL; }; + virtual const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + virtual const char * getType(){ return SETLOGGERLEVEL; }; + virtual const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif \ No newline at end of file