Decodes byte messages into u-blox ROS messages.
More...
#include <serialization.h>
|
uint16_t | checksum () |
| Get the checksum of the u-blox message. More...
|
|
uint8_t | classId () |
|
const uint8_t * | data () |
|
iterator | end () |
|
bool | found () |
| Has a u-blox message been found in the buffer? More...
|
|
template<typename T > |
bool | hasType () |
| Can the given message type decode the current message in the buffer? More...
|
|
bool | isMessage (uint8_t class_id, uint8_t message_id) |
| Does the u-blox message have the given class and message ID? More...
|
|
uint32_t | length () |
| Get the length of the u-blox message payload. More...
|
|
uint8_t | messageId () |
|
iterator | next () |
| Go to the start of the next message based on the received message length. More...
|
|
iterator | pos () |
| Get the current position in the read buffer. More...
|
|
template<typename T > |
bool | read (typename boost::call_traits< T >::reference message, bool search=false) |
| Decode the given message. More...
|
|
| 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. More...
|
|
Decodes byte messages into u-blox ROS messages.
Definition at line 167 of file serialization.h.
ublox::Reader::Reader |
( |
const uint8_t * |
data, |
|
|
uint32_t |
count, |
|
|
const Options & |
options = Options() |
|
) |
| |
|
inline |
- Parameters
-
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.
- Returns
- the checksum of the u-blox message
Definition at line 265 of file serialization.h.
uint8_t ublox::Reader::classId |
( |
| ) |
|
|
inline |
const uint8_t* ublox::Reader::data |
( |
| ) |
|
|
inline |
bool ublox::Reader::found |
( |
| ) |
|
|
inline |
Has a u-blox message been found in the buffer?
- Returns
- true if A message with the correct header & length has been found
Definition at line 203 of file serialization.h.
template<typename T >
bool ublox::Reader::hasType |
( |
| ) |
|
|
inline |
Can the given message type decode the current message in the buffer?
- Returns
- whether the given message type can 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?
- Returns
- Whether or not the u-blox message has 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.
- Returns
- the length of the message payload
Definition at line 257 of file serialization.h.
uint8_t ublox::Reader::messageId |
( |
| ) |
|
|
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.
Get the current position in the read buffer.
- Returns
- the current position of the read buffer
Definition at line 239 of file serialization.h.
template<typename T >
bool ublox::Reader::read |
( |
typename boost::call_traits< T >::reference |
message, |
|
|
bool |
search = false |
|
) |
| |
|
inline |
Decode the given message.
- Parameters
-
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.
Search the buffer for the beginning of the next u-blox message.
- Returns
- a pointer to the start 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 |
bool ublox::Reader::found_ |
|
private |
The documentation for this class was generated from the following file: