commit | fc91de7aee7f608787c84ad2b7b2d427a7220a3e | [log] [tgz] |
---|---|---|
author | Carlos Chinchilla <cachinchilla@google.com> | Thu Sep 28 23:13:10 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Sep 28 23:13:10 2023 +0000 |
tree | 9501ce59f093f53f1df893a26985611b80c94c7d | |
parent | 69a6925451f7f0ee0e9e444dda7679dac5d1ddb6 [diff] |
pw_{hdlc,rpc}: Add CancellableReader The new CancellableReader class wraps an interface used to receive RPC packets. It guarantees that its read process can be stopped to avoid blocking the join()-ing of the RpcClient's read and execute thread on close() or shutting down. There are specialized CancellableReader implementations for sockets and serial implementations, and a helper function that helps decide which type to use for a serial device depending on the OS. Otherwise, users must provide their own implementation that guarantees the read process can be stopped. Bug: 294858483 Change-Id: I2b69c9c8a5bfa2f877724a49fb1450c5865d00dd Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/172051 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Carlos Chinchilla <cachinchilla@google.com> Reviewed-by: Jonathon Reinhart <jrreinhart@google.com> Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@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/.