42 using ReceiveChunkFn = std::function<std::size_t(uint8_t* dst, std::size_t maxLen)>;
50 using SendBytesFn = std::function<bool(
const uint8_t* data, std::size_t length)>;
77 void PushChunk(
const uint8_t* data, std::size_t length);
88 template<
typename MsgType>
90 std::vector<uint8_t> buffer;
94 return m_send(buffer.data(), buffer.size());
98 ReceiveChunkFn m_receive;
SPI transport adapter for legacy SPI-based communication.
std::function< std::size_t(uint8_t *dst, std::size_t maxLen)> ReceiveChunkFn
Callback type for receiving SPI data chunks.
bool SendPacket(const TypedPacket< MsgType > &packet)
Send a typed packet over SPI.
std::function< bool(const uint8_t *data, std::size_t length)> SendBytesFn
Callback type for sending raw bytes over SPI.
Parses a byte stream into BCNP packets.
bool EncodeTypedPacket(const TypedPacket< MsgType, Storage > &packet, uint8_t *output, std::size_t capacity, std::size_t &bytesWritten)
Encode a typed packet to a pre-allocated buffer.
BCNP packet structures, encoding, and decoding utilities.
Generic packet containing messages of a specific type.