Commit Graph

3 Commits

Author SHA1 Message Date
Alexei Frolov
b9fda58850 pw_hdlc: Multibyte address support
This extends the HDLC encoder and decoder in both C++ and Python to use
HDLC extended addressing, where the address field is a one-terminated
LSB varint.

Classes using HDLC, such as the HDLC ChannelOutput and WirePacketParser,
are updated accordingly.

Change-Id: I6affc4443079628567d33939d809218f7b7bdf41
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/38020
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-03-19 18:36:03 +00:00
Alexei Frolov
44cd952f22 pw_hdlc: Calculate frame size before writing
This updates the WriteUIFrame function to calculate the worst-case
encoded frame size in advance and not write any data if it exceeds
the stream's write limit.

Change-Id: I315a2a94dbf19d6f3d021ecdee66d5329313f1d9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/29485
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2021-01-15 01:33:08 +00:00
Alexei Frolov
d3e5cb710d s/pw_hdlc_lite/pw_hdlc/g
This renames the hdlc_lite module to just HDLC to accommodate for future
development.

Change-Id: Ic96502a9f41d3a10179435347d4e8615bc3ae844
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/29042
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-01-11 21:16:53 +00:00