|
bool | existsID (uint8_t ID, uint8_t source) const |
| Checks if there is packet in buffer with specified ID and source address, which creates unique packet identifier. More...
|
|
int16_t | getIndexOfPacket (uint8_t ID, uint8_t source) const |
| Gets index of packet from unique packet identifier, which consists from ID and packet source address. More...
|
|
uint8_t | removeByDestination (uint8_t destination) |
| Removes all packets with specified destination. More...
|
|
const MeshPacket & | front () const |
| Gets the first (oldest) item from the buffer. More...
|
|
MeshPacket & | front () |
| Gets the first (oldest) item from the buffer. More...
|
|
const MeshPacket & | back () const |
| Gets the last (newest) item from the buffer. More...
|
|
MeshPacket & | back () |
| Gets the last (newest) item from the buffer. More...
|
|
bool | get (MeshPacket &item, uint8_t index) const |
| Gets item from the buffer by index. More...
|
|
const MeshPacket & | operator[] (int index) const |
| Gets item from the buffer by index. More...
|
|
MeshPacket & | operator[] (int index) |
| Gets item from the buffer by index. More...
|
|
void | push (MeshPacket const &item) |
| Pushes item after last item in buffer. When buffer is full, first (oldest) item will be overwritten and lostItemsCount() will be incremented by 1. More...
|
|
void | push (MeshPacket &&item) |
| Pushes item after last item in buffer. When buffer is full, first (oldest) item will be overwritten and lostItemsCount() will be incremented by 1. More...
|
|
MeshPacket && | popMove () |
| Reads and removes first (oldest) item from the buffer. When buffer is empty, exception may be thrown. This method is recommended to use only if std::move will be used. More...
|
|
bool | pop () |
| Removes first (oldest) item from the buffer. More...
|
|
bool | empty () const |
| Checks if buffer is empty. More...
|
|
uint8_t | count () const |
| Gets how many items are stored in buffer. More...
|
|
const uint8_t | size () const |
| Gets maximum count of items, that can be stored in buffer. More...
|
|
uint8_t | lostItemsCount () const |
|
void | restartLostItemsCounter () |
| Restarts lostItemsCount counter. More...
|
|
bool | removeAt (uint8_t index) |
| Removes item at specified index. After removing, count() will return new value. More...
|
|
uint8_t | removeMulti (uint8_t startPos_, uint8_t itmCount) |
| Removes number of item from specified index. After removing, count() will return new value. More...
|
|
uint8_t | removeIf (bool(*dec)(const MeshPacket &)) |
| Removes specified items. More...
|
|
void | clear () |
| Clears whole buffer. More...
|
|
size_t | getRawDataSize () const |
| Calculates, how many bytes will be printed, when using command printRaw. More...
|
|
virtual size_t | printRaw (OSTREAM &stream, const char *customTag) |
| Prints raw FIFO data through stream. Those data can be decoded in PC or in another MCU. More...
|
|
virtual size_t | print (OSTREAM &stream, bool showIndexes=true) const |
| Prints items as table from FIFO buffer to stream. More...
|
|
virtual size_t | sizeOf () const |
| Gets size of the whole FIFO in bytes. More...
|
|
size_t | printTo (Print &p) const override |
| Makes this class printable. More...
|
|
template<uint8_t BufferSize>
class MeshPacketFIFO< BufferSize >
Optimized FIFO buffer for microcontrolers, that can store only MeshPacket structure.
Size of the FIFO buffer in this example can store 255 MeshPackets.
How data are stored:
index (not physically stored) | MeshPacket |
0 | XXX |
1 | XXX |
... | ... |
XXX - depends on BufferSize | XXX |