Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: rosserial_mbed_lib mbed Servo
std_msgs/UInt8.h@3:dff241b66f84, 2011-11-12 (annotated)
- Committer:
- nucho
- Date:
- Sat Nov 12 23:53:04 2011 +0000
- Revision:
- 3:dff241b66f84
- Parent:
- 1:098e75fd5ad2
This program supported the revision of 167 of rosserial.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nucho | 3:dff241b66f84 | 1 | #ifndef _ROS_std_msgs_UInt8_h |
| nucho | 3:dff241b66f84 | 2 | #define _ROS_std_msgs_UInt8_h |
| nucho | 3:dff241b66f84 | 3 | |
| nucho | 3:dff241b66f84 | 4 | #include <stdint.h> |
| nucho | 3:dff241b66f84 | 5 | #include <string.h> |
| nucho | 3:dff241b66f84 | 6 | #include <stdlib.h> |
| nucho | 3:dff241b66f84 | 7 | #include "ros/msg.h" |
| nucho | 3:dff241b66f84 | 8 | |
| nucho | 3:dff241b66f84 | 9 | namespace std_msgs |
| nucho | 3:dff241b66f84 | 10 | { |
| nucho | 3:dff241b66f84 | 11 | |
| nucho | 3:dff241b66f84 | 12 | class UInt8 : public ros::Msg |
| nucho | 3:dff241b66f84 | 13 | { |
| nucho | 3:dff241b66f84 | 14 | public: |
| nucho | 3:dff241b66f84 | 15 | uint8_t data; |
| nucho | 3:dff241b66f84 | 16 | |
| nucho | 3:dff241b66f84 | 17 | virtual int serialize(unsigned char *outbuffer) const |
| nucho | 3:dff241b66f84 | 18 | { |
| nucho | 3:dff241b66f84 | 19 | int offset = 0; |
| nucho | 3:dff241b66f84 | 20 | *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; |
| nucho | 3:dff241b66f84 | 21 | offset += sizeof(this->data); |
| nucho | 3:dff241b66f84 | 22 | return offset; |
| nucho | 3:dff241b66f84 | 23 | } |
| nucho | 3:dff241b66f84 | 24 | |
| nucho | 3:dff241b66f84 | 25 | virtual int deserialize(unsigned char *inbuffer) |
| nucho | 3:dff241b66f84 | 26 | { |
| nucho | 3:dff241b66f84 | 27 | int offset = 0; |
| nucho | 3:dff241b66f84 | 28 | this->data |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
| nucho | 3:dff241b66f84 | 29 | offset += sizeof(this->data); |
| nucho | 3:dff241b66f84 | 30 | return offset; |
| nucho | 3:dff241b66f84 | 31 | } |
| nucho | 3:dff241b66f84 | 32 | |
| nucho | 3:dff241b66f84 | 33 | virtual const char * getType(){ return "std_msgs/UInt8"; }; |
| nucho | 3:dff241b66f84 | 34 | virtual const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; |
| nucho | 3:dff241b66f84 | 35 | |
| nucho | 3:dff241b66f84 | 36 | }; |
| nucho | 3:dff241b66f84 | 37 | |
| nucho | 3:dff241b66f84 | 38 | } |
| nucho | 0:06fc856e99ca | 39 | #endif |