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

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bool.h Source File

Bool.h

00001 #ifndef _ROS_std_msgs_Bool_h
00002 #define _ROS_std_msgs_Bool_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace std_msgs
00010 {
00011 
00012   class Bool : public ros::Msg
00013   {
00014     public:
00015       bool data;
00016 
00017     Bool():
00018       data(0)
00019     {
00020     }
00021 
00022     virtual int serialize(unsigned char *outbuffer) const
00023     {
00024       int offset = 0;
00025       union {
00026         bool real;
00027         uint8_t base;
00028       } u_data;
00029       u_data.real = this->data;
00030       *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
00031       offset += sizeof(this->data);
00032       return offset;
00033     }
00034 
00035     virtual int deserialize(unsigned char *inbuffer)
00036     {
00037       int offset = 0;
00038       union {
00039         bool real;
00040         uint8_t base;
00041       } u_data;
00042       u_data.base = 0;
00043       u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00044       this->data = u_data.real;
00045       offset += sizeof(this->data);
00046      return offset;
00047     }
00048 
00049     const char * getType(){ return "std_msgs/Bool"; };
00050     const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; };
00051 
00052   };
00053 
00054 }
00055 #endif