UpdatePins.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_UpdatePins_h
19 #define _ROS_SERVICE_UpdatePins_h
20 #include <stdint.h>
21 #include <string.h>
22 #include <stdlib.h>
23 #include "ros/msg.h"
24 
25 namespace cob_hand_bridge
26 {
27 
28 static const char UPDATEPINS[] = "cob_hand_bridge/UpdatePins";
29 
30  class UpdatePinsRequest : public ros::Msg
31  {
32  public:
33  uint32_t set_pins;
34  uint32_t clear_pins;
35 
37  set_pins(0),
38  clear_pins(0)
39  {
40  }
41 
42  virtual int serialize(unsigned char *outbuffer) const
43  {
44  int offset = 0;
45  *(outbuffer + offset + 0) = (this->set_pins >> (8 * 0)) & 0xFF;
46  *(outbuffer + offset + 1) = (this->set_pins >> (8 * 1)) & 0xFF;
47  *(outbuffer + offset + 2) = (this->set_pins >> (8 * 2)) & 0xFF;
48  *(outbuffer + offset + 3) = (this->set_pins >> (8 * 3)) & 0xFF;
49  offset += sizeof(this->set_pins);
50  *(outbuffer + offset + 0) = (this->clear_pins >> (8 * 0)) & 0xFF;
51  *(outbuffer + offset + 1) = (this->clear_pins >> (8 * 1)) & 0xFF;
52  *(outbuffer + offset + 2) = (this->clear_pins >> (8 * 2)) & 0xFF;
53  *(outbuffer + offset + 3) = (this->clear_pins >> (8 * 3)) & 0xFF;
54  offset += sizeof(this->clear_pins);
55  return offset;
56  }
57 
58  virtual int deserialize(unsigned char *inbuffer)
59  {
60  int offset = 0;
61  this->set_pins = ((uint32_t) (*(inbuffer + offset)));
62  this->set_pins |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
63  this->set_pins |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
64  this->set_pins |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
65  offset += sizeof(this->set_pins);
66  this->clear_pins = ((uint32_t) (*(inbuffer + offset)));
67  this->clear_pins |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
68  this->clear_pins |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
69  this->clear_pins |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
70  offset += sizeof(this->clear_pins);
71  return offset;
72  }
73 
74  const char * getType(){ return UPDATEPINS; };
75  const char * getMD5(){ return "54c611b52e3951b09beb1eddc8d57861"; };
76 
77  };
78 
80  {
81  public:
82  bool success;
83 
85  success(0)
86  {
87  }
88 
89  virtual int serialize(unsigned char *outbuffer) const
90  {
91  int offset = 0;
92  union {
93  bool real;
94  uint8_t base;
95  } u_success;
96  u_success.real = this->success;
97  *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
98  offset += sizeof(this->success);
99  return offset;
100  }
101 
102  virtual int deserialize(unsigned char *inbuffer)
103  {
104  int offset = 0;
105  union {
106  bool real;
107  uint8_t base;
108  } u_success;
109  u_success.base = 0;
110  u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
111  this->success = u_success.real;
112  offset += sizeof(this->success);
113  return offset;
114  }
115 
116  const char * getType(){ return UPDATEPINS; };
117  const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; };
118 
119  };
120 
121  class UpdatePins {
122  public:
125  };
126 
127 }
128 #endif
virtual int deserialize(unsigned char *inbuffer)
Definition: UpdatePins.h:58
static const char UPDATEPINS[]
Definition: UpdatePins.h:28
virtual int serialize(unsigned char *outbuffer) const
Definition: UpdatePins.h:42
UpdatePinsRequest Request
Definition: UpdatePins.h:123
virtual int serialize(unsigned char *outbuffer) const
Definition: UpdatePins.h:89
UpdatePinsResponse Response
Definition: UpdatePins.h:124
Definition: msg.h:26
virtual int deserialize(unsigned char *inbuffer)
Definition: UpdatePins.h:102


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