pw_rpc2: Improve call lifecycle, handshake, and cancellation - Call lifecycle & status tracking: Track completion with an explicit flag bit rather than a sentinel status, allowing Status::Unknown() to represent unrecognized peer error codes without ambiguity. - Cancellation: Make Cancel() complete calls locally with CANCELLED so pending reads and responses resolve immediately. Add Reader::Cancel() and cancel client calls when uncompleted readers or futures drop. - Server call retirement: Send a terminal error packet to the peer if a server call is retired while its writer is still open, preventing clients from hanging indefinitely on abandoned methods. - Client teardown: Track live Client handles with a refcount and automatically close the connection when the last handle is dropped. Streamline ClientConnectionTask closure using an atomic state and a binary semaphore turnstile. - Handshake negotiation: Transmit the negotiated version in handshake packets, accept packets of 8 or more bytes for forward compatibility, and reject version 0. - Sizing & write reservations: Add PwpbSerializer::ReservationSize to size bounded messages by exact content when the schema maximum exceeds transport MTU. Reject reservation commits on closed/cancelled calls. - Listener robustness: Re-arm Accept() and re-enqueue after connection allocation failures to prevent listeners from stalling. - Header organization: Split connection_task.h into connection_task.h, client_connection_task.h, and server_connection_task.h to match the source file structure. Change-Id: I5dac22f509a6a50b8e023cdad14d21a0a9deed26 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/sandbox/+/489809
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/.