Decodes byte messages into u-blox ROS messages. More...
#include <serialization.h>
Public Types | |
typedef const uint8_t * | iterator |
Public Member Functions | |
uint16_t | checksum () |
Get the checksum of the u-blox message. | |
uint8_t | classId () |
const uint8_t * | data () |
iterator | end () |
bool | found () |
Has a u-blox message been found in the buffer? | |
template<typename T > | |
bool | hasType () |
Can the given message type decode the current message in the buffer? | |
bool | isMessage (uint8_t class_id, uint8_t message_id) |
Does the u-blox message have the given class and message ID? | |
uint32_t | length () |
Get the length of the u-blox message payload. | |
uint8_t | messageId () |
iterator | next () |
Go to the start of the next message based on the received message length. | |
iterator | pos () |
Get the current position in the read buffer. | |
template<typename T > | |
bool | read (typename boost::call_traits< T >::reference message, bool search=false) |
Decode the given message. | |
Reader (const uint8_t *data, uint32_t count, const Options &options=Options()) | |
iterator | search () |
Search the buffer for the beginning of the next u-blox message. | |
Private Attributes | |
uint32_t | count_ |
the number of bytes in the buffer, //! decrement as the buffer is read | |
const uint8_t * | data_ |
The buffer of message bytes. | |
bool | found_ |
Whether or not a message has been found. | |
Options | options_ |
Options representing the sync char values, etc. |
Decodes byte messages into u-blox ROS messages.
Definition at line 167 of file serialization.h.
typedef const uint8_t* ublox::Reader::iterator |
Definition at line 179 of file serialization.h.
ublox::Reader::Reader | ( | const uint8_t * | data, |
uint32_t | count, | ||
const Options & | options = Options() |
||
) | [inline] |
data | a buffer containing u-blox messages |
count | the size of the buffer |
options | A struct containing the parameters sync_a and sync_b which represent the sync bytes indicating the beginning of the message |
Definition at line 175 of file serialization.h.
uint16_t ublox::Reader::checksum | ( | ) | [inline] |
Get the checksum of the u-blox message.
Definition at line 265 of file serialization.h.
uint8_t ublox::Reader::classId | ( | ) | [inline] |
Definition at line 247 of file serialization.h.
const uint8_t* ublox::Reader::data | ( | ) | [inline] |
Definition at line 258 of file serialization.h.
iterator ublox::Reader::end | ( | ) | [inline] |
Definition at line 243 of file serialization.h.
bool ublox::Reader::found | ( | ) | [inline] |
Has a u-blox message been found in the buffer?
Definition at line 203 of file serialization.h.
bool ublox::Reader::hasType | ( | ) | [inline] |
Can the given message type decode the current message in the buffer?
Definition at line 300 of file serialization.h.
bool ublox::Reader::isMessage | ( | uint8_t | class_id, |
uint8_t | message_id | ||
) | [inline] |
Does the u-blox message have the given class and message ID?
Definition at line 310 of file serialization.h.
uint32_t ublox::Reader::length | ( | ) | [inline] |
Get the length of the u-blox message payload.
Payload length does not include the header or checksum length. Determines the length from the header of the u-blox message.
Definition at line 257 of file serialization.h.
uint8_t ublox::Reader::messageId | ( | ) | [inline] |
Definition at line 248 of file serialization.h.
iterator ublox::Reader::next | ( | ) | [inline] |
Go to the start of the next message based on the received message length.
Warning: Does not go to the correct byte location if the received message length is incorrect. If this is the case, search must be called.
Definition at line 226 of file serialization.h.
iterator ublox::Reader::pos | ( | ) | [inline] |
Get the current position in the read buffer.
Definition at line 239 of file serialization.h.
bool ublox::Reader::read | ( | typename boost::call_traits< T >::reference | message, |
bool | search = false |
||
) | [inline] |
Decode the given message.
message | the output message |
search | whether or not to skip to the next message in the buffer |
Definition at line 276 of file serialization.h.
iterator ublox::Reader::search | ( | ) | [inline] |
Search the buffer for the beginning of the next u-blox message.
Definition at line 185 of file serialization.h.
uint32_t ublox::Reader::count_ [private] |
the number of bytes in the buffer, //! decrement as the buffer is read
Definition at line 319 of file serialization.h.
const uint8_t* ublox::Reader::data_ [private] |
The buffer of message bytes.
Definition at line 317 of file serialization.h.
bool ublox::Reader::found_ [private] |
Whether or not a message has been found.
Definition at line 321 of file serialization.h.
Options ublox::Reader::options_ [private] |
Options representing the sync char values, etc.
Definition at line 323 of file serialization.h.