RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lw::Packet Struct Reference

#include <lx16a.hpp>

Public Member Functions

 Packet ()=default
 
 Packet (const uint8_t *data, int len)
 
template<typename... Args>
 Packet (Id id, Command c, Args... data)
 
void _buildHeader ()
 
void _pushData ()
 
template<typename... Args>
void _pushData (uint8_t d, Args... data)
 
int size () const
 
bool valid () const
 
void dump ()
 

Static Public Member Functions

static Packet move (Id id, uint16_t position, uint16_t time)
 
static Packet limitAngle (Id id, uint16_t low, uint16_t high)
 
static Packet setId (Id id, Id newId)
 
static Packet getId (Id id)
 
static uint8_t _checksum (const std::vector< uint8_t > &data, int offset=2, int end_offset=0)
 

Public Attributes

std::vector< uint8_t > _data
 

Constructor & Destructor Documentation

◆ Packet() [1/3]

lw::Packet::Packet ( )
default

◆ Packet() [2/3]

lw::Packet::Packet ( const uint8_t *  data,
int  len 
)
inline

◆ Packet() [3/3]

template<typename... Args>
lw::Packet::Packet ( Id  id,
Command  c,
Args...  data 
)
inline

Member Function Documentation

◆ _buildHeader()

void lw::Packet::_buildHeader ( )
inline

◆ _checksum()

static uint8_t lw::Packet::_checksum ( const std::vector< uint8_t > &  data,
int  offset = 2,
int  end_offset = 0 
)
inlinestatic

◆ _pushData() [1/2]

void lw::Packet::_pushData ( )
inline

◆ _pushData() [2/2]

template<typename... Args>
void lw::Packet::_pushData ( uint8_t  d,
Args...  data 
)
inline

◆ dump()

void lw::Packet::dump ( )
inline

◆ getId()

static Packet lw::Packet::getId ( Id  id)
inlinestatic

◆ limitAngle()

static Packet lw::Packet::limitAngle ( Id  id,
uint16_t  low,
uint16_t  high 
)
inlinestatic

◆ move()

static Packet lw::Packet::move ( Id  id,
uint16_t  position,
uint16_t  time 
)
inlinestatic

◆ setId()

static Packet lw::Packet::setId ( Id  id,
Id  newId 
)
inlinestatic

◆ size()

int lw::Packet::size ( ) const
inline

◆ valid()

bool lw::Packet::valid ( ) const
inline

Member Data Documentation

◆ _data

std::vector<uint8_t> lw::Packet::_data

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