commit | 64a88a417ce3e2912964279c150677fcd8dd5745 | [log] [tgz] |
---|---|---|
author | Alexei Frolov <frolv@google.com> | Fri Aug 12 20:52:49 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Aug 12 20:52:49 2022 +0000 |
tree | 0ec5c6a310477210bd8dd9de96e8b6c2250789ae | |
parent | 400c0f3bdb19675e885f99f744f9d953b786015d [diff] |
pw_transfer: Version 2 opening handshake in C++ This implements the opening handshake of pw_transfer's version 2 protocol within the C++ transfer client and server. The handshake consists of protocol version negotiation and ephemeral session ID assignment. The protocol version used for a transfer session is controlled by the client when it starts a new transfer. By default, this still remains the legacy protocol for now, though the client API is extended to allow specifying the desired version. If the START chunk a transfer service receives is configured for version 2, the service will assign a transfer session ID and proceed with the handshake. Otherwise, it will fall back to the legacy protocol. The version 2 START chunk sent by a client retains all of the chunk proto fields set by the legacy protocol, allowing it to be understood by a server which is not version 2 aware. In such a case, the server will process the chunk per the legacy protocol and send a non-handshake response. The client will recognize the legacy response and revert to running the legacy protocol. As a result of this, version 2 capable transfer clients and servers remain fully backwards-compatible with older code that only runs the legacy protocol. Change-Id: Ie0a295509e754b963d3a78593ba1c43bbe13c977 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/99500 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Alexei Frolov <frolv@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/.