33 bool SendBytes(
const uint8_t* data, std::size_t length);
36 template<
typename MsgType>
38 std::vector<uint8_t> buffer;
42 return m_adapter.
SendBytes(buffer.data(), buffer.size());
48 std::vector<uint8_t> m_rxScratch;
virtual bool SendBytes(const uint8_t *data, std::size_t length)=0
Send bytes over the transport.
Drives a PacketDispatcher from a transport adapter.
DispatcherDriver(PacketDispatcher &dispatcher, DuplexAdapter &adapter)
bool SendBytes(const uint8_t *data, std::size_t length)
Send raw bytes through the adapter.
void PollOnce()
Poll transport and feed data to dispatcher.
bool SendPacket(const TypedPacket< MsgType > &packet)
Send a typed packet.
Combined send/receive interface for bidirectional transports.
Parses BCNP stream and dispatches packets to registered handlers.
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.
Generic packet containing messages of a specific type.