kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
RequestServiceInfo.h
Go to the documentation of this file.
1 #ifndef _ROS_SERVICE_RequestServiceInfo_h
2 #define _ROS_SERVICE_RequestServiceInfo_h
3 #include <stdint.h>
4 #include <string.h>
5 #include <stdlib.h>
6 #include "ros/msg.h"
7 
8 namespace rosserial_msgs
9 {
10 
11 static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo";
12 
14  {
15  public:
16  const char* service;
17 
19  service("")
20  {
21  }
22 
23  virtual int serialize(unsigned char *outbuffer) const
24  {
25  int offset = 0;
26  uint32_t length_service = strlen(this->service);
27  memcpy(outbuffer + offset, &length_service, sizeof(uint32_t));
28  offset += 4;
29  memcpy(outbuffer + offset, this->service, length_service);
30  offset += length_service;
31  return offset;
32  }
33 
34  virtual int deserialize(unsigned char *inbuffer)
35  {
36  int offset = 0;
37  uint32_t length_service;
38  memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t));
39  offset += 4;
40  for(unsigned int k= offset; k< offset+length_service; ++k){
41  inbuffer[k-1]=inbuffer[k];
42  }
43  inbuffer[offset+length_service-1]=0;
44  this->service = (char *)(inbuffer + offset-1);
45  offset += length_service;
46  return offset;
47  }
48 
49  const char * getType(){ return REQUESTSERVICEINFO; };
50  const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; };
51 
52  };
53 
55  {
56  public:
57  const char* service_md5;
58  const char* request_md5;
59  const char* response_md5;
60 
62  service_md5(""),
63  request_md5(""),
64  response_md5("")
65  {
66  }
67 
68  virtual int serialize(unsigned char *outbuffer) const
69  {
70  int offset = 0;
71  uint32_t length_service_md5 = strlen(this->service_md5);
72  memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t));
73  offset += 4;
74  memcpy(outbuffer + offset, this->service_md5, length_service_md5);
75  offset += length_service_md5;
76  uint32_t length_request_md5 = strlen(this->request_md5);
77  memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t));
78  offset += 4;
79  memcpy(outbuffer + offset, this->request_md5, length_request_md5);
80  offset += length_request_md5;
81  uint32_t length_response_md5 = strlen(this->response_md5);
82  memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t));
83  offset += 4;
84  memcpy(outbuffer + offset, this->response_md5, length_response_md5);
85  offset += length_response_md5;
86  return offset;
87  }
88 
89  virtual int deserialize(unsigned char *inbuffer)
90  {
91  int offset = 0;
92  uint32_t length_service_md5;
93  memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t));
94  offset += 4;
95  for(unsigned int k= offset; k< offset+length_service_md5; ++k){
96  inbuffer[k-1]=inbuffer[k];
97  }
98  inbuffer[offset+length_service_md5-1]=0;
99  this->service_md5 = (char *)(inbuffer + offset-1);
100  offset += length_service_md5;
101  uint32_t length_request_md5;
102  memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t));
103  offset += 4;
104  for(unsigned int k= offset; k< offset+length_request_md5; ++k){
105  inbuffer[k-1]=inbuffer[k];
106  }
107  inbuffer[offset+length_request_md5-1]=0;
108  this->request_md5 = (char *)(inbuffer + offset-1);
109  offset += length_request_md5;
110  uint32_t length_response_md5;
111  memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t));
112  offset += 4;
113  for(unsigned int k= offset; k< offset+length_response_md5; ++k){
114  inbuffer[k-1]=inbuffer[k];
115  }
116  inbuffer[offset+length_response_md5-1]=0;
117  this->response_md5 = (char *)(inbuffer + offset-1);
118  offset += length_response_md5;
119  return offset;
120  }
121 
122  const char * getType(){ return REQUESTSERVICEINFO; };
123  const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; };
124 
125  };
126 
128  public:
131  };
132 
133 }
134 #endif
RequestServiceInfoRequest()
Definition: RequestServiceInfo.h:18
virtual int deserialize(unsigned char *inbuffer)
Definition: RequestServiceInfo.h:89
const char * response_md5
Definition: RequestServiceInfo.h:59
const char * request_md5
Definition: RequestServiceInfo.h:58
virtual int serialize(unsigned char *outbuffer) const
Definition: RequestServiceInfo.h:68
static const char REQUESTSERVICEINFO[]
Definition: RequestServiceInfo.h:11
const char * getMD5()
Definition: RequestServiceInfo.h:50
const char * service_md5
Definition: RequestServiceInfo.h:57
const char * getType()
Definition: RequestServiceInfo.h:49
RequestServiceInfoResponse Response
Definition: RequestServiceInfo.h:130
RequestServiceInfoResponse()
Definition: RequestServiceInfo.h:61
virtual int serialize(unsigned char *outbuffer) const
Definition: RequestServiceInfo.h:23
const char * getType()
Definition: RequestServiceInfo.h:122
Definition: RequestServiceInfo.h:13
Definition: RequestServiceInfo.h:127
const char * getMD5()
Definition: RequestServiceInfo.h:123
RequestServiceInfoRequest Request
Definition: RequestServiceInfo.h:129
Definition: msg.h:43
Definition: RequestServiceInfo.h:54
virtual int deserialize(unsigned char *inbuffer)
Definition: RequestServiceInfo.h:34
const char * service
Definition: RequestServiceInfo.h:16