#include <framing.h>
◆ Unframer()
tvm::runtime::micro_rpc::Unframer::Unframer |
( |
WriteStream * |
stream | ) |
|
|
inlineexplicit |
◆ BytesNeeded()
size_t tvm::runtime::micro_rpc::Unframer::BytesNeeded |
( |
| ) |
|
Return an underestimate of the number of bytes needed from the wire.
◆ Reset()
void tvm::runtime::micro_rpc::Unframer::Reset |
( |
| ) |
|
Reset unframer to initial state.
◆ Write()
tvm_crt_error_t tvm::runtime::micro_rpc::Unframer::Write |
( |
const uint8_t * |
data, |
|
|
size_t |
data_size_bytes, |
|
|
size_t * |
bytes_consumed |
|
) |
| |
Push data into unframer and try to decode one packet.
This function will return when exactly one packet has been decoded. It may not consume all of data
in this case, and valid bytes may remain at the end of data.
- Parameters
-
data | The new data to unframe and send downstream. |
data_size_bytes | The number of valid bytes in data. |
bytes_consumed | Pointer written with the number of bytes consumed from data. |
- Returns
- kTvmErrorNoError when successful – continue writing data.
- kTvmErrorFramingInvalidState when the Unframer was in or enters an invalid state (probably indicates memory corruption).
- kTvmErrorFramingShortPacket when a new packet started before the current one ended.
- kTvmErrorFramingInvalidEscape when an invalid escape sequence was seen
The documentation for this class was generated from the following file: