63std::expected<std::vector<uint8_t>, std::string>
encodeFrame(
const Frame& frame);
Definition spoe_connection.cc:15
MessageType
The message types the firmware handles. A reply carries the type of its request.
Definition spoe_frame.h:20
std::optional< FrameHeader > decodeHeader(std::span< const uint8_t > bytes)
Definition spoe_frame.cc:36
std::expected< std::vector< uint8_t >, std::string > encodeFrame(const Frame &frame)
Encodes frame. Fails when the data part is larger than kMaxDataSize.
Definition spoe_frame.cc:18
constexpr std::size_t kHeaderSize
Message type u8, sequence id u16, status u16, data length u16.
Definition spoe_frame.h:41
constexpr std::size_t kMaxDataSize
MAX_FRAME_SIZE in the firmware: the size of its buffer for the data part.
Definition spoe_frame.h:44
std::size_t bytes
Definition spoe_connection.cc:24
Definition spoe_frame.h:55
uint16_t sequenceId
Definition spoe_frame.h:57
uint8_t type
Definition spoe_frame.h:56
std::vector< uint8_t > data
Definition spoe_frame.h:59
uint16_t status
Definition spoe_frame.h:58