Public Types | Public Member Functions | Private Attributes
ublox::Reader Class Reference

Decodes byte messages into u-blox ROS messages. More...

#include <serialization.h>

List of all members.

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.

Detailed Description

Decodes byte messages into u-blox ROS messages.

Definition at line 167 of file serialization.h.


Member Typedef Documentation

typedef const uint8_t* ublox::Reader::iterator

Definition at line 179 of file serialization.h.


Constructor & Destructor Documentation

ublox::Reader::Reader ( const uint8_t *  data,
uint32_t  count,
const Options options = Options() 
) [inline]
Parameters:
dataa buffer containing u-blox messages
countthe size of the buffer
optionsA 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.


Member Function Documentation

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]

Definition at line 247 of file serialization.h.

const uint8_t* ublox::Reader::data ( ) [inline]

Definition at line 258 of file serialization.h.

Definition at line 243 of file serialization.h.

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]

Definition at line 248 of file serialization.h.

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:
messagethe output message
searchwhether 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.


Member Data Documentation

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 representing the sync char values, etc.

Definition at line 323 of file serialization.h.


The documentation for this class was generated from the following file:


ublox_serialization
Author(s): Johannes Meyer
autogenerated on Fri Jun 14 2019 19:26:11