Byte-at-a-time decoder for frames received from the hub.
More...
#include <bno08x_shtp_uart.hpp>
|
| Event | Push (uint8_t c) noexcept |
| | Feed one received byte.
|
| |
| const uint8_t * | Data () const noexcept |
| | SHTP transfer of the last Event::ShtpFrame (header first).
|
| |
| std::size_t | Size () const noexcept |
| | Length of the last SHTP transfer.
|
| |
| uint16_t | BufferSpace () const noexcept |
| | Free space the hub reported in its last Buffer Status Notification.
|
| |
| void | ClearBufferSpace () noexcept |
| | Forget the reported buffer space (the next frame needs a new query).
|
| |
| void | Reset () noexcept |
| | Drop any partial frame and wait for the next flag.
|
| |
template<std::size_t Capacity>
class bno08x::shtp_uart::FrameDecoder< Capacity >
Byte-at-a-time decoder for frames received from the hub.
Push() every received byte. When it returns Event::ShtpFrame, Data() and Size() hold the SHTP transfer (protocol ID removed) until the next Push(). Event::BufferStatus updates BufferSpace(). Bytes outside a frame are ignored, and a frame that overflows Capacity or has an unknown protocol ID is reported as Event::Dropped.
- Template Parameters
-
| Capacity | Largest frame payload kept, protocol ID included. |
◆ Event
template<std::size_t Capacity>
What the last byte completed.
| Enumerator |
|---|
| None | Nothing complete yet.
|
| ShtpFrame | An SHTP transfer is in Data() / Size().
|
| BufferStatus | A Buffer Status Notification updated BufferSpace().
|
| Dropped | A frame was discarded (overflow or unknown protocol ID).
|
◆ BufferSpace()
template<std::size_t Capacity>
Free space the hub reported in its last Buffer Status Notification.
◆ ClearBufferSpace()
template<std::size_t Capacity>
Forget the reported buffer space (the next frame needs a new query).
◆ Data()
template<std::size_t Capacity>
◆ Push()
template<std::size_t Capacity>
◆ Reset()
template<std::size_t Capacity>
Drop any partial frame and wait for the next flag.
◆ Size()
template<std::size_t Capacity>
Length of the last SHTP transfer.
The documentation for this class was generated from the following file: