Encodes a u-blox ROS message as a byte array. More...
#include <serialization.h>
Public Types | |
typedef uint8_t * | iterator |
Public Member Functions | |
iterator | end () |
template<typename T > | |
bool | write (const T &message, uint8_t class_id=T::CLASS_ID, uint8_t message_id=T::MESSAGE_ID) |
Encode the u-blox message. | |
bool | write (const uint8_t *message, uint32_t length, uint8_t class_id, uint8_t message_id) |
Wrap the encoded message payload with a header and checksum and add it to the buffer. | |
Writer (uint8_t *data, uint32_t size, const Options &options=Options()) | |
Construct a Writer with the given buffer. | |
Private Attributes | |
iterator | data_ |
The buffer of message bytes. | |
Options | options_ |
Options representing the sync char values, etc. | |
uint32_t | size_ |
The number of remaining bytes in the buffer. |
Encodes a u-blox ROS message as a byte array.
Definition at line 329 of file serialization.h.
typedef uint8_t* ublox::Writer::iterator |
Definition at line 331 of file serialization.h.
ublox::Writer::Writer | ( | uint8_t * | data, |
uint32_t | size, | ||
const Options & | options = Options() |
||
) | [inline] |
Construct a Writer with the given buffer.
data | a buffer for messages |
size | the size of the buffer |
options | options representing the message sync chars, etc. |
Definition at line 339 of file serialization.h.
iterator ublox::Writer::end | ( | ) | [inline] |
Definition at line 407 of file serialization.h.
bool ublox::Writer::write | ( | const T & | message, |
uint8_t | class_id = T::CLASS_ID , |
||
uint8_t | message_id = T::MESSAGE_ID |
||
) | [inline] |
Encode the u-blox message.
message | the message to encode |
class_id | the u-blox class ID, defaults to the message CLASS_ID |
message_id | the u-blox message ID, defaults to the message MESSAGE_ID |
Definition at line 349 of file serialization.h.
bool ublox::Writer::write | ( | const uint8_t * | message, |
uint32_t | length, | ||
uint8_t | class_id, | ||
uint8_t | message_id | ||
) | [inline] |
Wrap the encoded message payload with a header and checksum and add it to the buffer.
message | the encoded message payload (no header or checksum) |
length | the length of the message payload |
class_id | the u-blox class ID |
message_id | the u-blox message ID |
Definition at line 374 of file serialization.h.
iterator ublox::Writer::data_ [private] |
The buffer of message bytes.
Definition at line 413 of file serialization.h.
Options ublox::Writer::options_ [private] |
Options representing the sync char values, etc.
Definition at line 418 of file serialization.h.
uint32_t ublox::Writer::size_ [private] |
The number of remaining bytes in the buffer.
Decrements as messages are written to the buffer
Definition at line 416 of file serialization.h.