Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_StopController_h
00002 #define _ROS_SERVICE_StopController_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007
00008 namespace dynamixel_controllers
00009 {
00010
00011 static const char STOPCONTROLLER[] = "dynamixel_controllers/StopController";
00012
00013 class StopControllerRequest : public ros::Msg
00014 {
00015 public:
00016 const char* controller_name;
00017
00018 virtual int serialize(unsigned char *outbuffer) const
00019 {
00020 int offset = 0;
00021 uint32_t length_controller_name = strlen(this->controller_name);
00022 memcpy(outbuffer + offset, &length_controller_name, sizeof(uint32_t));
00023 offset += 4;
00024 memcpy(outbuffer + offset, this->controller_name, length_controller_name);
00025 offset += length_controller_name;
00026 return offset;
00027 }
00028
00029 virtual int deserialize(unsigned char *inbuffer)
00030 {
00031 int offset = 0;
00032 uint32_t length_controller_name;
00033 memcpy(&length_controller_name, (inbuffer + offset), sizeof(uint32_t));
00034 offset += 4;
00035 for(unsigned int k= offset; k< offset+length_controller_name; ++k){
00036 inbuffer[k-1]=inbuffer[k];
00037 }
00038 inbuffer[offset+length_controller_name-1]=0;
00039 this->controller_name = (char *)(inbuffer + offset-1);
00040 offset += length_controller_name;
00041 return offset;
00042 }
00043
00044 const char * getType(){ return STOPCONTROLLER; };
00045 const char * getMD5(){ return "df2b10f2f876d82269ae3fc1e0538e11"; };
00046
00047 };
00048
00049 class StopControllerResponse : public ros::Msg
00050 {
00051 public:
00052 bool success;
00053 const char* reason;
00054
00055 virtual int serialize(unsigned char *outbuffer) const
00056 {
00057 int offset = 0;
00058 union {
00059 bool real;
00060 uint8_t base;
00061 } u_success;
00062 u_success.real = this->success;
00063 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00064 offset += sizeof(this->success);
00065 uint32_t length_reason = strlen(this->reason);
00066 memcpy(outbuffer + offset, &length_reason, sizeof(uint32_t));
00067 offset += 4;
00068 memcpy(outbuffer + offset, this->reason, length_reason);
00069 offset += length_reason;
00070 return offset;
00071 }
00072
00073 virtual int deserialize(unsigned char *inbuffer)
00074 {
00075 int offset = 0;
00076 union {
00077 bool real;
00078 uint8_t base;
00079 } u_success;
00080 u_success.base = 0;
00081 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00082 this->success = u_success.real;
00083 offset += sizeof(this->success);
00084 uint32_t length_reason;
00085 memcpy(&length_reason, (inbuffer + offset), sizeof(uint32_t));
00086 offset += 4;
00087 for(unsigned int k= offset; k< offset+length_reason; ++k){
00088 inbuffer[k-1]=inbuffer[k];
00089 }
00090 inbuffer[offset+length_reason-1]=0;
00091 this->reason = (char *)(inbuffer + offset-1);
00092 offset += length_reason;
00093 return offset;
00094 }
00095
00096 const char * getType(){ return STOPCONTROLLER; };
00097 const char * getMD5(){ return "a4d50a34d34f18de48e2436ff1472594"; };
00098
00099 };
00100
00101 class StopController {
00102 public:
00103 typedef StopControllerRequest Request;
00104 typedef StopControllerResponse Response;
00105 };
00106
00107 }
00108 #endif