Skyward boardcore
|
The Packet class is used for packing together messages with variable lengths into a fixed size packet. Useful for telemetry. More...
#include <SyncPacketQueue.h>
Public Member Functions | |
Packet () | |
Reserves a fixed length for the packet. | |
~Packet () | |
Clears the buffer. | |
size_t | append (const uint8_t *msg, size_t msgLen) |
Append a given message to the packet. | |
void | markAsReady () |
Mark the packet as ready. | |
size_t | dump (uint8_t *buf) |
Copies the content of the payload at the given address. | |
void | clear () |
Clear the buffer and reset members. | |
bool | isFull () const |
bool | isEmpty () const |
bool | isReady () const |
uint64_t | getTimestamp () const |
size_t | size () const |
unsigned int | maxSize () const |
unsigned int | getMsgCount () const |
void | print (std::ostream &os) const |
Print information about this object. | |
Public Attributes | |
std::vector< uint8_t > | content |
The Packet class is used for packing together messages with variable lengths into a fixed size packet. Useful for telemetry.
Data can only be appended to the payload. The packet can be marked ready.
len | Packet's payload length. |
Definition at line 55 of file SyncPacketQueue.h.
|
inline |
Reserves a fixed length for the packet.
Definition at line 61 of file SyncPacketQueue.h.
|
inline |
Clears the buffer.
Definition at line 66 of file SyncPacketQueue.h.
size_t Boardcore::Packet< len >::append | ( | const uint8_t * | msg, |
size_t | msgLen ) |
Append a given message to the packet.
If the message can't fit inside the remaining space only the first bytes are copied.
msg | The message to be appended. |
msgLen | Length of the message. |
Definition at line 151 of file SyncPacketQueue.h.
void Boardcore::Packet< len >::clear | ( | ) |
Clear the buffer and reset members.
Definition at line 171 of file SyncPacketQueue.h.
size_t Boardcore::Packet< len >::dump | ( | uint8_t * | buf | ) |
Copies the content of the payload at the given address.
buf | Where to copy the content. |
Definition at line 180 of file SyncPacketQueue.h.
|
inline |
Definition at line 132 of file SyncPacketQueue.h.
|
inline |
Definition at line 116 of file SyncPacketQueue.h.
|
inline |
Definition at line 106 of file SyncPacketQueue.h.
|
inline |
Definition at line 101 of file SyncPacketQueue.h.
|
inline |
Definition at line 111 of file SyncPacketQueue.h.
|
inline |
Mark the packet as ready.
Definition at line 83 of file SyncPacketQueue.h.
|
inline |
Definition at line 126 of file SyncPacketQueue.h.
void Boardcore::Packet< len >::print | ( | std::ostream & | os | ) | const |
Print information about this object.
os | For example, std::cout. |
Definition at line 187 of file SyncPacketQueue.h.
|
inline |
Definition at line 121 of file SyncPacketQueue.h.
std::vector<uint8_t> Boardcore::Packet< len >::content |
Definition at line 142 of file SyncPacketQueue.h.