RequestServiceInfo.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef _ROS_SERVICE_RequestServiceInfo_h
19 #define _ROS_SERVICE_RequestServiceInfo_h
20 #include <stdint.h>
21 #include <string.h>
22 #include <stdlib.h>
23 #include "ros/msg.h"
24 
25 namespace rosserial_msgs
26 {
27 
28 static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo";
29 
31  {
32  public:
33  const char* service;
34 
36  service("")
37  {
38  }
39 
40  virtual int serialize(unsigned char *outbuffer) const
41  {
42  int offset = 0;
43  uint32_t length_service = strlen(this->service);
44  memcpy(outbuffer + offset, &length_service, sizeof(uint32_t));
45  offset += 4;
46  memcpy(outbuffer + offset, this->service, length_service);
47  offset += length_service;
48  return offset;
49  }
50 
51  virtual int deserialize(unsigned char *inbuffer)
52  {
53  int offset = 0;
54  uint32_t length_service;
55  memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t));
56  offset += 4;
57  for(unsigned int k= offset; k< offset+length_service; ++k){
58  inbuffer[k-1]=inbuffer[k];
59  }
60  inbuffer[offset+length_service-1]=0;
61  this->service = (char *)(inbuffer + offset-1);
62  offset += length_service;
63  return offset;
64  }
65 
66  const char * getType(){ return REQUESTSERVICEINFO; };
67  const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; };
68 
69  };
70 
72  {
73  public:
74  const char* service_md5;
75  const char* request_md5;
76  const char* response_md5;
77 
79  service_md5(""),
80  request_md5(""),
81  response_md5("")
82  {
83  }
84 
85  virtual int serialize(unsigned char *outbuffer) const
86  {
87  int offset = 0;
88  uint32_t length_service_md5 = strlen(this->service_md5);
89  memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t));
90  offset += 4;
91  memcpy(outbuffer + offset, this->service_md5, length_service_md5);
92  offset += length_service_md5;
93  uint32_t length_request_md5 = strlen(this->request_md5);
94  memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t));
95  offset += 4;
96  memcpy(outbuffer + offset, this->request_md5, length_request_md5);
97  offset += length_request_md5;
98  uint32_t length_response_md5 = strlen(this->response_md5);
99  memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t));
100  offset += 4;
101  memcpy(outbuffer + offset, this->response_md5, length_response_md5);
102  offset += length_response_md5;
103  return offset;
104  }
105 
106  virtual int deserialize(unsigned char *inbuffer)
107  {
108  int offset = 0;
109  uint32_t length_service_md5;
110  memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t));
111  offset += 4;
112  for(unsigned int k= offset; k< offset+length_service_md5; ++k){
113  inbuffer[k-1]=inbuffer[k];
114  }
115  inbuffer[offset+length_service_md5-1]=0;
116  this->service_md5 = (char *)(inbuffer + offset-1);
117  offset += length_service_md5;
118  uint32_t length_request_md5;
119  memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t));
120  offset += 4;
121  for(unsigned int k= offset; k< offset+length_request_md5; ++k){
122  inbuffer[k-1]=inbuffer[k];
123  }
124  inbuffer[offset+length_request_md5-1]=0;
125  this->request_md5 = (char *)(inbuffer + offset-1);
126  offset += length_request_md5;
127  uint32_t length_response_md5;
128  memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t));
129  offset += 4;
130  for(unsigned int k= offset; k< offset+length_response_md5; ++k){
131  inbuffer[k-1]=inbuffer[k];
132  }
133  inbuffer[offset+length_response_md5-1]=0;
134  this->response_md5 = (char *)(inbuffer + offset-1);
135  offset += length_response_md5;
136  return offset;
137  }
138 
139  const char * getType(){ return REQUESTSERVICEINFO; };
140  const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; };
141 
142  };
143 
145  public:
148  };
149 
150 }
151 #endif
virtual int deserialize(unsigned char *inbuffer)
virtual int serialize(unsigned char *outbuffer) const
static const char REQUESTSERVICEINFO[]
RequestServiceInfoResponse Response
virtual int serialize(unsigned char *outbuffer) const
RequestServiceInfoRequest Request
Definition: msg.h:26
virtual int deserialize(unsigned char *inbuffer)


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Tue Oct 20 2020 03:35:57