1 #ifndef _ROS_rosserial_msgs_TopicInfo_h
2 #define _ROS_rosserial_msgs_TopicInfo_h
9 namespace rosserial_msgs
38 virtual int serialize(
unsigned char *outbuffer)
const
41 *(outbuffer + offset + 0) = (this->
topic_id >> (8 * 0)) & 0xFF;
42 *(outbuffer + offset + 1) = (this->
topic_id >> (8 * 1)) & 0xFF;
44 uint32_t length_topic_name = strlen(this->
topic_name);
45 memcpy(outbuffer + offset, &length_topic_name,
sizeof(uint32_t));
47 memcpy(outbuffer + offset, this->
topic_name, length_topic_name);
48 offset += length_topic_name;
49 uint32_t length_message_type = strlen(this->
message_type);
50 memcpy(outbuffer + offset, &length_message_type,
sizeof(uint32_t));
52 memcpy(outbuffer + offset, this->
message_type, length_message_type);
53 offset += length_message_type;
54 uint32_t length_md5sum = strlen(this->
md5sum);
55 memcpy(outbuffer + offset, &length_md5sum,
sizeof(uint32_t));
57 memcpy(outbuffer + offset, this->
md5sum, length_md5sum);
58 offset += length_md5sum;
64 *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF;
65 *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF;
66 *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF;
67 *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF;
75 this->
topic_id = ((uint16_t) (*(inbuffer + offset)));
76 this->
topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
78 uint32_t length_topic_name;
79 memcpy(&length_topic_name, (inbuffer + offset),
sizeof(uint32_t));
81 for(
unsigned int k= offset; k< offset+length_topic_name; ++k){
82 inbuffer[k-1]=inbuffer[k];
84 inbuffer[offset+length_topic_name-1]=0;
85 this->
topic_name = (
char *)(inbuffer + offset-1);
86 offset += length_topic_name;
87 uint32_t length_message_type;
88 memcpy(&length_message_type, (inbuffer + offset),
sizeof(uint32_t));
90 for(
unsigned int k= offset; k< offset+length_message_type; ++k){
91 inbuffer[k-1]=inbuffer[k];
93 inbuffer[offset+length_message_type-1]=0;
95 offset += length_message_type;
96 uint32_t length_md5sum;
97 memcpy(&length_md5sum, (inbuffer + offset),
sizeof(uint32_t));
99 for(
unsigned int k= offset; k< offset+length_md5sum; ++k){
100 inbuffer[k-1]=inbuffer[k];
102 inbuffer[offset+length_md5sum-1]=0;
103 this->
md5sum = (
char *)(inbuffer + offset-1);
104 offset += length_md5sum;
109 u_buffer_size.base = 0;
110 u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
111 u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
112 u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
113 u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
119 const char *
getType(){
return "rosserial_msgs/TopicInfo"; };
120 const char *
getMD5(){
return "0ad51f88fc44892f8c10684077646005"; };
Definition: TopicInfo.h:24
Definition: TopicInfo.h:12
const char * topic_name
Definition: TopicInfo.h:16
virtual int serialize(unsigned char *outbuffer) const
Definition: TopicInfo.h:38
Definition: TopicInfo.h:25
const char * getMD5()
Definition: TopicInfo.h:120
const char * md5sum
Definition: TopicInfo.h:18
const char * getType()
Definition: TopicInfo.h:119
Definition: TopicInfo.h:20
int32_t buffer_size
Definition: TopicInfo.h:19
virtual int deserialize(unsigned char *inbuffer)
Definition: TopicInfo.h:72
Definition: TopicInfo.h:27
const char * message_type
Definition: TopicInfo.h:17
Definition: TopicInfo.h:21
TopicInfo()
Definition: TopicInfo.h:29
Definition: TopicInfo.h:22
Definition: TopicInfo.h:23
Definition: TopicInfo.h:26
uint16_t topic_id
Definition: TopicInfo.h:15