Go to the documentation of this file.00001 #ifndef ros_SERVICE_SetCameraInfo_h
00002 #define ros_SERVICE_SetCameraInfo_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "../ros/msg.h"
00007 #include "sensor_msgs/CameraInfo.h"
00008
00009 namespace sensor_msgs
00010 {
00011
00012 static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo";
00013
00014 class SetCameraInfoRequest : public ros::Msg
00015 {
00016 public:
00017 sensor_msgs::CameraInfo camera_info;
00018
00019 virtual int serialize(unsigned char *outbuffer)
00020 {
00021 int offset = 0;
00022 offset += this->camera_info.serialize(outbuffer + offset);
00023 return offset;
00024 }
00025
00026 virtual int deserialize(unsigned char *inbuffer)
00027 {
00028 int offset = 0;
00029 offset += this->camera_info.deserialize(inbuffer + offset);
00030 return offset;
00031 }
00032
00033 const char * getType(){ return SETCAMERAINFO; };
00034
00035 };
00036
00037 class SetCameraInfoResponse : public ros::Msg
00038 {
00039 public:
00040 bool success;
00041 char * status_message;
00042
00043 virtual int serialize(unsigned char *outbuffer)
00044 {
00045 int offset = 0;
00046 union {
00047 bool real;
00048 unsigned char base;
00049 } u_success;
00050 u_success.real = this->success;
00051 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00052 offset += sizeof(this->success);
00053 long * length_status_message = (long *)(outbuffer + offset);
00054 *length_status_message = strlen( (const char*) this->status_message);
00055 offset += 4;
00056 memcpy(outbuffer + offset, this->status_message, *length_status_message);
00057 offset += *length_status_message;
00058 return offset;
00059 }
00060
00061 virtual int deserialize(unsigned char *inbuffer)
00062 {
00063 int offset = 0;
00064 union {
00065 bool real;
00066 unsigned char base;
00067 } u_success;
00068 u_success.base = 0;
00069 u_success.base |= ((typeof(u_success.base)) (*(inbuffer + offset + 0))) << (8 * 0);
00070 this->success = u_success.real;
00071 offset += sizeof(this->success);
00072 uint32_t length_status_message = *(uint32_t *)(inbuffer + offset);
00073 offset += 4;
00074 for(unsigned int k= offset; k< offset+length_status_message; ++k){
00075 inbuffer[k-1]=inbuffer[k];
00076 }
00077 inbuffer[offset+length_status_message-1]=0;
00078 this->status_message = (char *)(inbuffer + offset-1);
00079 offset += length_status_message;
00080 return offset;
00081 }
00082
00083 const char * getType(){ return SETCAMERAINFO; };
00084
00085 };
00086
00087 }
00088 #endif