Duplex.h
Go to the documentation of this file.
1 #ifndef _ROS_rosabridge_msgs_Duplex_h
2 #define _ROS_rosabridge_msgs_Duplex_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace rosabridge_msgs
10 {
11 
12  class Duplex : public ros::Msg
13  {
14  public:
15  float a;
16  float b;
17 
18  virtual int serialize(unsigned char *outbuffer) const
19  {
20  int offset = 0;
21  union {
22  float real;
23  uint32_t base;
24  } u_a;
25  u_a.real = this->a;
26  *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF;
27  *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF;
28  *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF;
29  *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF;
30  offset += sizeof(this->a);
31  union {
32  float real;
33  uint32_t base;
34  } u_b;
35  u_b.real = this->b;
36  *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF;
37  *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF;
38  *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF;
39  *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF;
40  offset += sizeof(this->b);
41  return offset;
42  }
43 
44  virtual int deserialize(unsigned char *inbuffer)
45  {
46  int offset = 0;
47  union {
48  float real;
49  uint32_t base;
50  } u_a;
51  u_a.base = 0;
52  u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
53  u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
54  u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
55  u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
56  this->a = u_a.real;
57  offset += sizeof(this->a);
58  union {
59  float real;
60  uint32_t base;
61  } u_b;
62  u_b.base = 0;
63  u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
64  u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
65  u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
66  u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
67  this->b = u_b.real;
68  offset += sizeof(this->b);
69  return offset;
70  }
71 
72  const char * getType(){ return "rosabridge_msgs/Duplex"; };
73  const char * getMD5(){ return "3f6326d24b4937f854196fd3a843f42e"; };
74 
75  };
76 
77 }
78 #endif
const char * getType()
Definition: Duplex.h:72
virtual int serialize(unsigned char *outbuffer) const
Definition: Duplex.h:18
virtual int deserialize(unsigned char *inbuffer)
Definition: Duplex.h:44
const char * getMD5()
Definition: Duplex.h:73


rosabridge_arduino
Author(s): Chad Attermann
autogenerated on Sat Apr 10 2021 02:37:49