commit | a230ae449576bc3e0933fa567c58da2a33ebde13 | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Wed Mar 13 03:54:56 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Mar 13 03:54:56 2024 +0000 |
tree | b9ee10b77c49fc8e2673821e9ef82f838f79e1f3 | |
parent | 22961f56a2bdc9897d452209429d03655daa006e [diff] |
pw_channel: Support datagram-to-byte conversions The original Channel implementation did not allow datagram channels to be used as byte channels. This is because zero-length reads and writes are semantically different. A zero-length datagram write produces a zero-length datagram read on the other end; a zero-length byte write is a no-op. - Document the semantic difference, but allow datagram channels to be used as byte channels, with the understanding that zero-length writes may produce a meaningless zero-length read in some cases. - Make kDatagram a property and support datagram-to-byte conversions like any other property. - Make ByteChannel and DatagramChannel aliases of Channel<>. - Reintroduce the AnyChannel base class as originally proposed. Change-Id: I7eb15d4f797ab1e58453e61d289998577e2656ab Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/196210 Reviewed-by: Taylor Cramer <cramertj@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com> Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.