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: BufferedSerial
std_msgs/Duration.h@9:ccd662244071, 2019-11-21 (annotated)
- Committer:
- Jeonghoon
- Date:
- Thu Nov 21 10:36:11 2019 +0000
- Revision:
- 9:ccd662244071
- Parent:
- 3:2a3664dc6634
complete ov7670;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Jeonghoon | 3:2a3664dc6634 | 1 | #ifndef _ROS_std_msgs_Duration_h |
| Jeonghoon | 3:2a3664dc6634 | 2 | #define _ROS_std_msgs_Duration_h |
| Jeonghoon | 3:2a3664dc6634 | 3 | |
| Jeonghoon | 3:2a3664dc6634 | 4 | #include <stdint.h> |
| Jeonghoon | 3:2a3664dc6634 | 5 | #include <string.h> |
| Jeonghoon | 3:2a3664dc6634 | 6 | #include <stdlib.h> |
| Jeonghoon | 3:2a3664dc6634 | 7 | #include "ros/msg.h" |
| Jeonghoon | 3:2a3664dc6634 | 8 | #include "ros/duration.h" |
| Jeonghoon | 3:2a3664dc6634 | 9 | |
| Jeonghoon | 3:2a3664dc6634 | 10 | namespace std_msgs |
| Jeonghoon | 3:2a3664dc6634 | 11 | { |
| Jeonghoon | 3:2a3664dc6634 | 12 | |
| Jeonghoon | 3:2a3664dc6634 | 13 | class Duration : public ros::Msg |
| Jeonghoon | 3:2a3664dc6634 | 14 | { |
| Jeonghoon | 3:2a3664dc6634 | 15 | public: |
| Jeonghoon | 3:2a3664dc6634 | 16 | typedef ros::Duration _data_type; |
| Jeonghoon | 3:2a3664dc6634 | 17 | _data_type data; |
| Jeonghoon | 3:2a3664dc6634 | 18 | |
| Jeonghoon | 3:2a3664dc6634 | 19 | Duration(): |
| Jeonghoon | 3:2a3664dc6634 | 20 | data() |
| Jeonghoon | 3:2a3664dc6634 | 21 | { |
| Jeonghoon | 3:2a3664dc6634 | 22 | } |
| Jeonghoon | 3:2a3664dc6634 | 23 | |
| Jeonghoon | 3:2a3664dc6634 | 24 | virtual int serialize(unsigned char *outbuffer) const |
| Jeonghoon | 3:2a3664dc6634 | 25 | { |
| Jeonghoon | 3:2a3664dc6634 | 26 | int offset = 0; |
| Jeonghoon | 3:2a3664dc6634 | 27 | *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 28 | *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 29 | *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 30 | *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 31 | offset += sizeof(this->data.sec); |
| Jeonghoon | 3:2a3664dc6634 | 32 | *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 33 | *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 34 | *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 35 | *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; |
| Jeonghoon | 3:2a3664dc6634 | 36 | offset += sizeof(this->data.nsec); |
| Jeonghoon | 3:2a3664dc6634 | 37 | return offset; |
| Jeonghoon | 3:2a3664dc6634 | 38 | } |
| Jeonghoon | 3:2a3664dc6634 | 39 | |
| Jeonghoon | 3:2a3664dc6634 | 40 | virtual int deserialize(unsigned char *inbuffer) |
| Jeonghoon | 3:2a3664dc6634 | 41 | { |
| Jeonghoon | 3:2a3664dc6634 | 42 | int offset = 0; |
| Jeonghoon | 3:2a3664dc6634 | 43 | this->data.sec = ((uint32_t) (*(inbuffer + offset))); |
| Jeonghoon | 3:2a3664dc6634 | 44 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| Jeonghoon | 3:2a3664dc6634 | 45 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| Jeonghoon | 3:2a3664dc6634 | 46 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| Jeonghoon | 3:2a3664dc6634 | 47 | offset += sizeof(this->data.sec); |
| Jeonghoon | 3:2a3664dc6634 | 48 | this->data.nsec = ((uint32_t) (*(inbuffer + offset))); |
| Jeonghoon | 3:2a3664dc6634 | 49 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| Jeonghoon | 3:2a3664dc6634 | 50 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| Jeonghoon | 3:2a3664dc6634 | 51 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| Jeonghoon | 3:2a3664dc6634 | 52 | offset += sizeof(this->data.nsec); |
| Jeonghoon | 3:2a3664dc6634 | 53 | return offset; |
| Jeonghoon | 3:2a3664dc6634 | 54 | } |
| Jeonghoon | 3:2a3664dc6634 | 55 | |
| Jeonghoon | 3:2a3664dc6634 | 56 | const char * getType(){ return "std_msgs/Duration"; }; |
| Jeonghoon | 3:2a3664dc6634 | 57 | const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; |
| Jeonghoon | 3:2a3664dc6634 | 58 | |
| Jeonghoon | 3:2a3664dc6634 | 59 | }; |
| Jeonghoon | 3:2a3664dc6634 | 60 | |
| Jeonghoon | 3:2a3664dc6634 | 61 | } |
| Jeonghoon | 3:2a3664dc6634 | 62 | #endif |