Simple, robust, and efficient serial communication.
◆ StartUnnumberedFrame()
| Status pw::hdlc::Encoder::StartUnnumberedFrame |
( |
uint64_t |
address | ) |
|
|
inline |
◆ WriteData()
Writes data for an ongoing frame. Must only be called after a successful StartInformationFrame() call, and prior to a FinishFrame() call.
◆ WriteUIFrame()
Writes an HDLC unnumbered information frame (UI frame) to the provided pw::stream writer.
This function is a convenience alias for the more general Encoder type and set of functions.
- Parameters
-
| address | The frame address. |
| payload | The frame data to encode. |
| writer | The pw::stream to write the frame to. The frame contains the following bytes. See Design for more information.
- HDLC flag byte (
0x7e)
- Address (variable length, up to 10 bytes)
- UI-frame control (metadata) byte
- Payload (0 or more bytes)
- Frame check sequence (CRC-32, 4 bytes)
- HDLC flag byte (
0x7e)
|
- Returns
- OK: The write finished successfully.
- RESOURCE_EXHAUSTED: The write failed because the size of the frame would be larger than the writer's conservative limit.
- INVALID_ARGUMENT: The start of the write failed. Check for problems in your
address argument's value.