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

Encodes a u-blox ROS message as a byte array. More...

#include <serialization.h>

List of all members.

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.

Detailed Description

Encodes a u-blox ROS message as a byte array.

Definition at line 329 of file serialization.h.


Member Typedef Documentation

typedef uint8_t* ublox::Writer::iterator

Definition at line 331 of file serialization.h.


Constructor & Destructor Documentation

ublox::Writer::Writer ( uint8_t *  data,
uint32_t  size,
const Options options = Options() 
) [inline]

Construct a Writer with the given buffer.

Parameters:
dataa buffer for messages
sizethe size of the buffer
optionsoptions representing the message sync chars, etc.

Definition at line 339 of file serialization.h.


Member Function Documentation

Definition at line 407 of file serialization.h.

template<typename T >
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.

Parameters:
messagethe message to encode
class_idthe u-blox class ID, defaults to the message CLASS_ID
message_idthe u-blox message ID, defaults to the message MESSAGE_ID
Returns:
true if the message was encoded correctly, false otherwise

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.

Parameters:
messagethe encoded message payload (no header or checksum)
lengththe length of the message payload
class_idthe u-blox class ID
message_idthe u-blox message ID
Returns:
true if the message was encoded correctly, false otherwise

Definition at line 374 of file serialization.h.


Member Data Documentation

The buffer of message bytes.

Definition at line 413 of file serialization.h.

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.


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


ublox_serialization
Author(s): Johannes Meyer
autogenerated on Fri Aug 11 2017 02:31:03