ROS Serial library for Mbed platforms for ROS Melodic Morenia. Check http://wiki.ros.org/rosserial_mbed/ for more information.

Dependencies:   BufferedSerial

Committer:
krogedal
Date:
Thu May 27 19:25:46 2021 +0000
Revision:
2:fa426560b283
Parent:
0:04ac6be8229a
no change

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Gary Servin 0:04ac6be8229a 1 #ifndef _ROS_SERVICE_GetModelProperties_h
Gary Servin 0:04ac6be8229a 2 #define _ROS_SERVICE_GetModelProperties_h
Gary Servin 0:04ac6be8229a 3 #include <stdint.h>
Gary Servin 0:04ac6be8229a 4 #include <string.h>
Gary Servin 0:04ac6be8229a 5 #include <stdlib.h>
Gary Servin 0:04ac6be8229a 6 #include "ros/msg.h"
Gary Servin 0:04ac6be8229a 7
Gary Servin 0:04ac6be8229a 8 namespace gazebo_msgs
Gary Servin 0:04ac6be8229a 9 {
Gary Servin 0:04ac6be8229a 10
Gary Servin 0:04ac6be8229a 11 static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties";
Gary Servin 0:04ac6be8229a 12
Gary Servin 0:04ac6be8229a 13 class GetModelPropertiesRequest : public ros::Msg
Gary Servin 0:04ac6be8229a 14 {
Gary Servin 0:04ac6be8229a 15 public:
Gary Servin 0:04ac6be8229a 16 typedef const char* _model_name_type;
Gary Servin 0:04ac6be8229a 17 _model_name_type model_name;
Gary Servin 0:04ac6be8229a 18
Gary Servin 0:04ac6be8229a 19 GetModelPropertiesRequest():
Gary Servin 0:04ac6be8229a 20 model_name("")
Gary Servin 0:04ac6be8229a 21 {
Gary Servin 0:04ac6be8229a 22 }
Gary Servin 0:04ac6be8229a 23
Gary Servin 0:04ac6be8229a 24 virtual int serialize(unsigned char *outbuffer) const
Gary Servin 0:04ac6be8229a 25 {
Gary Servin 0:04ac6be8229a 26 int offset = 0;
Gary Servin 0:04ac6be8229a 27 uint32_t length_model_name = strlen(this->model_name);
Gary Servin 0:04ac6be8229a 28 varToArr(outbuffer + offset, length_model_name);
Gary Servin 0:04ac6be8229a 29 offset += 4;
Gary Servin 0:04ac6be8229a 30 memcpy(outbuffer + offset, this->model_name, length_model_name);
Gary Servin 0:04ac6be8229a 31 offset += length_model_name;
Gary Servin 0:04ac6be8229a 32 return offset;
Gary Servin 0:04ac6be8229a 33 }
Gary Servin 0:04ac6be8229a 34
Gary Servin 0:04ac6be8229a 35 virtual int deserialize(unsigned char *inbuffer)
Gary Servin 0:04ac6be8229a 36 {
Gary Servin 0:04ac6be8229a 37 int offset = 0;
Gary Servin 0:04ac6be8229a 38 uint32_t length_model_name;
Gary Servin 0:04ac6be8229a 39 arrToVar(length_model_name, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 40 offset += 4;
Gary Servin 0:04ac6be8229a 41 for(unsigned int k= offset; k< offset+length_model_name; ++k){
Gary Servin 0:04ac6be8229a 42 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 43 }
Gary Servin 0:04ac6be8229a 44 inbuffer[offset+length_model_name-1]=0;
Gary Servin 0:04ac6be8229a 45 this->model_name = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 46 offset += length_model_name;
Gary Servin 0:04ac6be8229a 47 return offset;
Gary Servin 0:04ac6be8229a 48 }
Gary Servin 0:04ac6be8229a 49
Gary Servin 0:04ac6be8229a 50 const char * getType(){ return GETMODELPROPERTIES; };
Gary Servin 0:04ac6be8229a 51 const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; };
Gary Servin 0:04ac6be8229a 52
Gary Servin 0:04ac6be8229a 53 };
Gary Servin 0:04ac6be8229a 54
Gary Servin 0:04ac6be8229a 55 class GetModelPropertiesResponse : public ros::Msg
Gary Servin 0:04ac6be8229a 56 {
Gary Servin 0:04ac6be8229a 57 public:
Gary Servin 0:04ac6be8229a 58 typedef const char* _parent_model_name_type;
Gary Servin 0:04ac6be8229a 59 _parent_model_name_type parent_model_name;
Gary Servin 0:04ac6be8229a 60 typedef const char* _canonical_body_name_type;
Gary Servin 0:04ac6be8229a 61 _canonical_body_name_type canonical_body_name;
Gary Servin 0:04ac6be8229a 62 uint32_t body_names_length;
Gary Servin 0:04ac6be8229a 63 typedef char* _body_names_type;
Gary Servin 0:04ac6be8229a 64 _body_names_type st_body_names;
Gary Servin 0:04ac6be8229a 65 _body_names_type * body_names;
Gary Servin 0:04ac6be8229a 66 uint32_t geom_names_length;
Gary Servin 0:04ac6be8229a 67 typedef char* _geom_names_type;
Gary Servin 0:04ac6be8229a 68 _geom_names_type st_geom_names;
Gary Servin 0:04ac6be8229a 69 _geom_names_type * geom_names;
Gary Servin 0:04ac6be8229a 70 uint32_t joint_names_length;
Gary Servin 0:04ac6be8229a 71 typedef char* _joint_names_type;
Gary Servin 0:04ac6be8229a 72 _joint_names_type st_joint_names;
Gary Servin 0:04ac6be8229a 73 _joint_names_type * joint_names;
Gary Servin 0:04ac6be8229a 74 uint32_t child_model_names_length;
Gary Servin 0:04ac6be8229a 75 typedef char* _child_model_names_type;
Gary Servin 0:04ac6be8229a 76 _child_model_names_type st_child_model_names;
Gary Servin 0:04ac6be8229a 77 _child_model_names_type * child_model_names;
Gary Servin 0:04ac6be8229a 78 typedef bool _is_static_type;
Gary Servin 0:04ac6be8229a 79 _is_static_type is_static;
Gary Servin 0:04ac6be8229a 80 typedef bool _success_type;
Gary Servin 0:04ac6be8229a 81 _success_type success;
Gary Servin 0:04ac6be8229a 82 typedef const char* _status_message_type;
Gary Servin 0:04ac6be8229a 83 _status_message_type status_message;
Gary Servin 0:04ac6be8229a 84
Gary Servin 0:04ac6be8229a 85 GetModelPropertiesResponse():
Gary Servin 0:04ac6be8229a 86 parent_model_name(""),
Gary Servin 0:04ac6be8229a 87 canonical_body_name(""),
Gary Servin 0:04ac6be8229a 88 body_names_length(0), body_names(NULL),
Gary Servin 0:04ac6be8229a 89 geom_names_length(0), geom_names(NULL),
Gary Servin 0:04ac6be8229a 90 joint_names_length(0), joint_names(NULL),
Gary Servin 0:04ac6be8229a 91 child_model_names_length(0), child_model_names(NULL),
Gary Servin 0:04ac6be8229a 92 is_static(0),
Gary Servin 0:04ac6be8229a 93 success(0),
Gary Servin 0:04ac6be8229a 94 status_message("")
Gary Servin 0:04ac6be8229a 95 {
Gary Servin 0:04ac6be8229a 96 }
Gary Servin 0:04ac6be8229a 97
Gary Servin 0:04ac6be8229a 98 virtual int serialize(unsigned char *outbuffer) const
Gary Servin 0:04ac6be8229a 99 {
Gary Servin 0:04ac6be8229a 100 int offset = 0;
Gary Servin 0:04ac6be8229a 101 uint32_t length_parent_model_name = strlen(this->parent_model_name);
Gary Servin 0:04ac6be8229a 102 varToArr(outbuffer + offset, length_parent_model_name);
Gary Servin 0:04ac6be8229a 103 offset += 4;
Gary Servin 0:04ac6be8229a 104 memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name);
Gary Servin 0:04ac6be8229a 105 offset += length_parent_model_name;
Gary Servin 0:04ac6be8229a 106 uint32_t length_canonical_body_name = strlen(this->canonical_body_name);
Gary Servin 0:04ac6be8229a 107 varToArr(outbuffer + offset, length_canonical_body_name);
Gary Servin 0:04ac6be8229a 108 offset += 4;
Gary Servin 0:04ac6be8229a 109 memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name);
Gary Servin 0:04ac6be8229a 110 offset += length_canonical_body_name;
Gary Servin 0:04ac6be8229a 111 *(outbuffer + offset + 0) = (this->body_names_length >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 112 *(outbuffer + offset + 1) = (this->body_names_length >> (8 * 1)) & 0xFF;
Gary Servin 0:04ac6be8229a 113 *(outbuffer + offset + 2) = (this->body_names_length >> (8 * 2)) & 0xFF;
Gary Servin 0:04ac6be8229a 114 *(outbuffer + offset + 3) = (this->body_names_length >> (8 * 3)) & 0xFF;
Gary Servin 0:04ac6be8229a 115 offset += sizeof(this->body_names_length);
Gary Servin 0:04ac6be8229a 116 for( uint32_t i = 0; i < body_names_length; i++){
Gary Servin 0:04ac6be8229a 117 uint32_t length_body_namesi = strlen(this->body_names[i]);
Gary Servin 0:04ac6be8229a 118 varToArr(outbuffer + offset, length_body_namesi);
Gary Servin 0:04ac6be8229a 119 offset += 4;
Gary Servin 0:04ac6be8229a 120 memcpy(outbuffer + offset, this->body_names[i], length_body_namesi);
Gary Servin 0:04ac6be8229a 121 offset += length_body_namesi;
Gary Servin 0:04ac6be8229a 122 }
Gary Servin 0:04ac6be8229a 123 *(outbuffer + offset + 0) = (this->geom_names_length >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 124 *(outbuffer + offset + 1) = (this->geom_names_length >> (8 * 1)) & 0xFF;
Gary Servin 0:04ac6be8229a 125 *(outbuffer + offset + 2) = (this->geom_names_length >> (8 * 2)) & 0xFF;
Gary Servin 0:04ac6be8229a 126 *(outbuffer + offset + 3) = (this->geom_names_length >> (8 * 3)) & 0xFF;
Gary Servin 0:04ac6be8229a 127 offset += sizeof(this->geom_names_length);
Gary Servin 0:04ac6be8229a 128 for( uint32_t i = 0; i < geom_names_length; i++){
Gary Servin 0:04ac6be8229a 129 uint32_t length_geom_namesi = strlen(this->geom_names[i]);
Gary Servin 0:04ac6be8229a 130 varToArr(outbuffer + offset, length_geom_namesi);
Gary Servin 0:04ac6be8229a 131 offset += 4;
Gary Servin 0:04ac6be8229a 132 memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi);
Gary Servin 0:04ac6be8229a 133 offset += length_geom_namesi;
Gary Servin 0:04ac6be8229a 134 }
Gary Servin 0:04ac6be8229a 135 *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 136 *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF;
Gary Servin 0:04ac6be8229a 137 *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF;
Gary Servin 0:04ac6be8229a 138 *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF;
Gary Servin 0:04ac6be8229a 139 offset += sizeof(this->joint_names_length);
Gary Servin 0:04ac6be8229a 140 for( uint32_t i = 0; i < joint_names_length; i++){
Gary Servin 0:04ac6be8229a 141 uint32_t length_joint_namesi = strlen(this->joint_names[i]);
Gary Servin 0:04ac6be8229a 142 varToArr(outbuffer + offset, length_joint_namesi);
Gary Servin 0:04ac6be8229a 143 offset += 4;
Gary Servin 0:04ac6be8229a 144 memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi);
Gary Servin 0:04ac6be8229a 145 offset += length_joint_namesi;
Gary Servin 0:04ac6be8229a 146 }
Gary Servin 0:04ac6be8229a 147 *(outbuffer + offset + 0) = (this->child_model_names_length >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 148 *(outbuffer + offset + 1) = (this->child_model_names_length >> (8 * 1)) & 0xFF;
Gary Servin 0:04ac6be8229a 149 *(outbuffer + offset + 2) = (this->child_model_names_length >> (8 * 2)) & 0xFF;
Gary Servin 0:04ac6be8229a 150 *(outbuffer + offset + 3) = (this->child_model_names_length >> (8 * 3)) & 0xFF;
Gary Servin 0:04ac6be8229a 151 offset += sizeof(this->child_model_names_length);
Gary Servin 0:04ac6be8229a 152 for( uint32_t i = 0; i < child_model_names_length; i++){
Gary Servin 0:04ac6be8229a 153 uint32_t length_child_model_namesi = strlen(this->child_model_names[i]);
Gary Servin 0:04ac6be8229a 154 varToArr(outbuffer + offset, length_child_model_namesi);
Gary Servin 0:04ac6be8229a 155 offset += 4;
Gary Servin 0:04ac6be8229a 156 memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi);
Gary Servin 0:04ac6be8229a 157 offset += length_child_model_namesi;
Gary Servin 0:04ac6be8229a 158 }
Gary Servin 0:04ac6be8229a 159 union {
Gary Servin 0:04ac6be8229a 160 bool real;
Gary Servin 0:04ac6be8229a 161 uint8_t base;
Gary Servin 0:04ac6be8229a 162 } u_is_static;
Gary Servin 0:04ac6be8229a 163 u_is_static.real = this->is_static;
Gary Servin 0:04ac6be8229a 164 *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 165 offset += sizeof(this->is_static);
Gary Servin 0:04ac6be8229a 166 union {
Gary Servin 0:04ac6be8229a 167 bool real;
Gary Servin 0:04ac6be8229a 168 uint8_t base;
Gary Servin 0:04ac6be8229a 169 } u_success;
Gary Servin 0:04ac6be8229a 170 u_success.real = this->success;
Gary Servin 0:04ac6be8229a 171 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
Gary Servin 0:04ac6be8229a 172 offset += sizeof(this->success);
Gary Servin 0:04ac6be8229a 173 uint32_t length_status_message = strlen(this->status_message);
Gary Servin 0:04ac6be8229a 174 varToArr(outbuffer + offset, length_status_message);
Gary Servin 0:04ac6be8229a 175 offset += 4;
Gary Servin 0:04ac6be8229a 176 memcpy(outbuffer + offset, this->status_message, length_status_message);
Gary Servin 0:04ac6be8229a 177 offset += length_status_message;
Gary Servin 0:04ac6be8229a 178 return offset;
Gary Servin 0:04ac6be8229a 179 }
Gary Servin 0:04ac6be8229a 180
Gary Servin 0:04ac6be8229a 181 virtual int deserialize(unsigned char *inbuffer)
Gary Servin 0:04ac6be8229a 182 {
Gary Servin 0:04ac6be8229a 183 int offset = 0;
Gary Servin 0:04ac6be8229a 184 uint32_t length_parent_model_name;
Gary Servin 0:04ac6be8229a 185 arrToVar(length_parent_model_name, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 186 offset += 4;
Gary Servin 0:04ac6be8229a 187 for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){
Gary Servin 0:04ac6be8229a 188 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 189 }
Gary Servin 0:04ac6be8229a 190 inbuffer[offset+length_parent_model_name-1]=0;
Gary Servin 0:04ac6be8229a 191 this->parent_model_name = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 192 offset += length_parent_model_name;
Gary Servin 0:04ac6be8229a 193 uint32_t length_canonical_body_name;
Gary Servin 0:04ac6be8229a 194 arrToVar(length_canonical_body_name, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 195 offset += 4;
Gary Servin 0:04ac6be8229a 196 for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){
Gary Servin 0:04ac6be8229a 197 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 198 }
Gary Servin 0:04ac6be8229a 199 inbuffer[offset+length_canonical_body_name-1]=0;
Gary Servin 0:04ac6be8229a 200 this->canonical_body_name = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 201 offset += length_canonical_body_name;
Gary Servin 0:04ac6be8229a 202 uint32_t body_names_lengthT = ((uint32_t) (*(inbuffer + offset)));
Gary Servin 0:04ac6be8229a 203 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Gary Servin 0:04ac6be8229a 204 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Gary Servin 0:04ac6be8229a 205 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Gary Servin 0:04ac6be8229a 206 offset += sizeof(this->body_names_length);
Gary Servin 0:04ac6be8229a 207 if(body_names_lengthT > body_names_length)
Gary Servin 0:04ac6be8229a 208 this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*));
Gary Servin 0:04ac6be8229a 209 body_names_length = body_names_lengthT;
Gary Servin 0:04ac6be8229a 210 for( uint32_t i = 0; i < body_names_length; i++){
Gary Servin 0:04ac6be8229a 211 uint32_t length_st_body_names;
Gary Servin 0:04ac6be8229a 212 arrToVar(length_st_body_names, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 213 offset += 4;
Gary Servin 0:04ac6be8229a 214 for(unsigned int k= offset; k< offset+length_st_body_names; ++k){
Gary Servin 0:04ac6be8229a 215 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 216 }
Gary Servin 0:04ac6be8229a 217 inbuffer[offset+length_st_body_names-1]=0;
Gary Servin 0:04ac6be8229a 218 this->st_body_names = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 219 offset += length_st_body_names;
Gary Servin 0:04ac6be8229a 220 memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*));
Gary Servin 0:04ac6be8229a 221 }
Gary Servin 0:04ac6be8229a 222 uint32_t geom_names_lengthT = ((uint32_t) (*(inbuffer + offset)));
Gary Servin 0:04ac6be8229a 223 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Gary Servin 0:04ac6be8229a 224 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Gary Servin 0:04ac6be8229a 225 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Gary Servin 0:04ac6be8229a 226 offset += sizeof(this->geom_names_length);
Gary Servin 0:04ac6be8229a 227 if(geom_names_lengthT > geom_names_length)
Gary Servin 0:04ac6be8229a 228 this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*));
Gary Servin 0:04ac6be8229a 229 geom_names_length = geom_names_lengthT;
Gary Servin 0:04ac6be8229a 230 for( uint32_t i = 0; i < geom_names_length; i++){
Gary Servin 0:04ac6be8229a 231 uint32_t length_st_geom_names;
Gary Servin 0:04ac6be8229a 232 arrToVar(length_st_geom_names, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 233 offset += 4;
Gary Servin 0:04ac6be8229a 234 for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){
Gary Servin 0:04ac6be8229a 235 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 236 }
Gary Servin 0:04ac6be8229a 237 inbuffer[offset+length_st_geom_names-1]=0;
Gary Servin 0:04ac6be8229a 238 this->st_geom_names = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 239 offset += length_st_geom_names;
Gary Servin 0:04ac6be8229a 240 memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*));
Gary Servin 0:04ac6be8229a 241 }
Gary Servin 0:04ac6be8229a 242 uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset)));
Gary Servin 0:04ac6be8229a 243 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Gary Servin 0:04ac6be8229a 244 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Gary Servin 0:04ac6be8229a 245 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Gary Servin 0:04ac6be8229a 246 offset += sizeof(this->joint_names_length);
Gary Servin 0:04ac6be8229a 247 if(joint_names_lengthT > joint_names_length)
Gary Servin 0:04ac6be8229a 248 this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*));
Gary Servin 0:04ac6be8229a 249 joint_names_length = joint_names_lengthT;
Gary Servin 0:04ac6be8229a 250 for( uint32_t i = 0; i < joint_names_length; i++){
Gary Servin 0:04ac6be8229a 251 uint32_t length_st_joint_names;
Gary Servin 0:04ac6be8229a 252 arrToVar(length_st_joint_names, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 253 offset += 4;
Gary Servin 0:04ac6be8229a 254 for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){
Gary Servin 0:04ac6be8229a 255 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 256 }
Gary Servin 0:04ac6be8229a 257 inbuffer[offset+length_st_joint_names-1]=0;
Gary Servin 0:04ac6be8229a 258 this->st_joint_names = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 259 offset += length_st_joint_names;
Gary Servin 0:04ac6be8229a 260 memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*));
Gary Servin 0:04ac6be8229a 261 }
Gary Servin 0:04ac6be8229a 262 uint32_t child_model_names_lengthT = ((uint32_t) (*(inbuffer + offset)));
Gary Servin 0:04ac6be8229a 263 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Gary Servin 0:04ac6be8229a 264 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Gary Servin 0:04ac6be8229a 265 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Gary Servin 0:04ac6be8229a 266 offset += sizeof(this->child_model_names_length);
Gary Servin 0:04ac6be8229a 267 if(child_model_names_lengthT > child_model_names_length)
Gary Servin 0:04ac6be8229a 268 this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*));
Gary Servin 0:04ac6be8229a 269 child_model_names_length = child_model_names_lengthT;
Gary Servin 0:04ac6be8229a 270 for( uint32_t i = 0; i < child_model_names_length; i++){
Gary Servin 0:04ac6be8229a 271 uint32_t length_st_child_model_names;
Gary Servin 0:04ac6be8229a 272 arrToVar(length_st_child_model_names, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 273 offset += 4;
Gary Servin 0:04ac6be8229a 274 for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){
Gary Servin 0:04ac6be8229a 275 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 276 }
Gary Servin 0:04ac6be8229a 277 inbuffer[offset+length_st_child_model_names-1]=0;
Gary Servin 0:04ac6be8229a 278 this->st_child_model_names = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 279 offset += length_st_child_model_names;
Gary Servin 0:04ac6be8229a 280 memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*));
Gary Servin 0:04ac6be8229a 281 }
Gary Servin 0:04ac6be8229a 282 union {
Gary Servin 0:04ac6be8229a 283 bool real;
Gary Servin 0:04ac6be8229a 284 uint8_t base;
Gary Servin 0:04ac6be8229a 285 } u_is_static;
Gary Servin 0:04ac6be8229a 286 u_is_static.base = 0;
Gary Servin 0:04ac6be8229a 287 u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
Gary Servin 0:04ac6be8229a 288 this->is_static = u_is_static.real;
Gary Servin 0:04ac6be8229a 289 offset += sizeof(this->is_static);
Gary Servin 0:04ac6be8229a 290 union {
Gary Servin 0:04ac6be8229a 291 bool real;
Gary Servin 0:04ac6be8229a 292 uint8_t base;
Gary Servin 0:04ac6be8229a 293 } u_success;
Gary Servin 0:04ac6be8229a 294 u_success.base = 0;
Gary Servin 0:04ac6be8229a 295 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
Gary Servin 0:04ac6be8229a 296 this->success = u_success.real;
Gary Servin 0:04ac6be8229a 297 offset += sizeof(this->success);
Gary Servin 0:04ac6be8229a 298 uint32_t length_status_message;
Gary Servin 0:04ac6be8229a 299 arrToVar(length_status_message, (inbuffer + offset));
Gary Servin 0:04ac6be8229a 300 offset += 4;
Gary Servin 0:04ac6be8229a 301 for(unsigned int k= offset; k< offset+length_status_message; ++k){
Gary Servin 0:04ac6be8229a 302 inbuffer[k-1]=inbuffer[k];
Gary Servin 0:04ac6be8229a 303 }
Gary Servin 0:04ac6be8229a 304 inbuffer[offset+length_status_message-1]=0;
Gary Servin 0:04ac6be8229a 305 this->status_message = (char *)(inbuffer + offset-1);
Gary Servin 0:04ac6be8229a 306 offset += length_status_message;
Gary Servin 0:04ac6be8229a 307 return offset;
Gary Servin 0:04ac6be8229a 308 }
Gary Servin 0:04ac6be8229a 309
Gary Servin 0:04ac6be8229a 310 const char * getType(){ return GETMODELPROPERTIES; };
Gary Servin 0:04ac6be8229a 311 const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; };
Gary Servin 0:04ac6be8229a 312
Gary Servin 0:04ac6be8229a 313 };
Gary Servin 0:04ac6be8229a 314
Gary Servin 0:04ac6be8229a 315 class GetModelProperties {
Gary Servin 0:04ac6be8229a 316 public:
Gary Servin 0:04ac6be8229a 317 typedef GetModelPropertiesRequest Request;
Gary Servin 0:04ac6be8229a 318 typedef GetModelPropertiesResponse Response;
Gary Servin 0:04ac6be8229a 319 };
Gary Servin 0:04ac6be8229a 320
Gary Servin 0:04ac6be8229a 321 }
Gary Servin 0:04ac6be8229a 322 #endif