Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ROS_SERVICE_RequestServiceInfo_h
00019 #define _ROS_SERVICE_RequestServiceInfo_h
00020 #include <stdint.h>
00021 #include <string.h>
00022 #include <stdlib.h>
00023 #include "ros/msg.h"
00024
00025 namespace rosserial_msgs
00026 {
00027
00028 static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo";
00029
00030 class RequestServiceInfoRequest : public ros::Msg
00031 {
00032 public:
00033 const char* service;
00034
00035 RequestServiceInfoRequest():
00036 service("")
00037 {
00038 }
00039
00040 virtual int serialize(unsigned char *outbuffer) const
00041 {
00042 int offset = 0;
00043 uint32_t length_service = strlen(this->service);
00044 memcpy(outbuffer + offset, &length_service, sizeof(uint32_t));
00045 offset += 4;
00046 memcpy(outbuffer + offset, this->service, length_service);
00047 offset += length_service;
00048 return offset;
00049 }
00050
00051 virtual int deserialize(unsigned char *inbuffer)
00052 {
00053 int offset = 0;
00054 uint32_t length_service;
00055 memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t));
00056 offset += 4;
00057 for(unsigned int k= offset; k< offset+length_service; ++k){
00058 inbuffer[k-1]=inbuffer[k];
00059 }
00060 inbuffer[offset+length_service-1]=0;
00061 this->service = (char *)(inbuffer + offset-1);
00062 offset += length_service;
00063 return offset;
00064 }
00065
00066 const char * getType(){ return REQUESTSERVICEINFO; };
00067 const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; };
00068
00069 };
00070
00071 class RequestServiceInfoResponse : public ros::Msg
00072 {
00073 public:
00074 const char* service_md5;
00075 const char* request_md5;
00076 const char* response_md5;
00077
00078 RequestServiceInfoResponse():
00079 service_md5(""),
00080 request_md5(""),
00081 response_md5("")
00082 {
00083 }
00084
00085 virtual int serialize(unsigned char *outbuffer) const
00086 {
00087 int offset = 0;
00088 uint32_t length_service_md5 = strlen(this->service_md5);
00089 memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t));
00090 offset += 4;
00091 memcpy(outbuffer + offset, this->service_md5, length_service_md5);
00092 offset += length_service_md5;
00093 uint32_t length_request_md5 = strlen(this->request_md5);
00094 memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t));
00095 offset += 4;
00096 memcpy(outbuffer + offset, this->request_md5, length_request_md5);
00097 offset += length_request_md5;
00098 uint32_t length_response_md5 = strlen(this->response_md5);
00099 memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t));
00100 offset += 4;
00101 memcpy(outbuffer + offset, this->response_md5, length_response_md5);
00102 offset += length_response_md5;
00103 return offset;
00104 }
00105
00106 virtual int deserialize(unsigned char *inbuffer)
00107 {
00108 int offset = 0;
00109 uint32_t length_service_md5;
00110 memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t));
00111 offset += 4;
00112 for(unsigned int k= offset; k< offset+length_service_md5; ++k){
00113 inbuffer[k-1]=inbuffer[k];
00114 }
00115 inbuffer[offset+length_service_md5-1]=0;
00116 this->service_md5 = (char *)(inbuffer + offset-1);
00117 offset += length_service_md5;
00118 uint32_t length_request_md5;
00119 memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t));
00120 offset += 4;
00121 for(unsigned int k= offset; k< offset+length_request_md5; ++k){
00122 inbuffer[k-1]=inbuffer[k];
00123 }
00124 inbuffer[offset+length_request_md5-1]=0;
00125 this->request_md5 = (char *)(inbuffer + offset-1);
00126 offset += length_request_md5;
00127 uint32_t length_response_md5;
00128 memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t));
00129 offset += 4;
00130 for(unsigned int k= offset; k< offset+length_response_md5; ++k){
00131 inbuffer[k-1]=inbuffer[k];
00132 }
00133 inbuffer[offset+length_response_md5-1]=0;
00134 this->response_md5 = (char *)(inbuffer + offset-1);
00135 offset += length_response_md5;
00136 return offset;
00137 }
00138
00139 const char * getType(){ return REQUESTSERVICEINFO; };
00140 const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; };
00141
00142 };
00143
00144 class RequestServiceInfo {
00145 public:
00146 typedef RequestServiceInfoRequest Request;
00147 typedef RequestServiceInfoResponse Response;
00148 };
00149
00150 }
00151 #endif