Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds stream support to MemoryConfigClient (#688)
- Adds new commands to the MemoryConfigClientRequest to initiate stream reads. - Adds a subclass MemoryConfigClientWithStream that can be instantiated instead of MemoryConfigClient if the application needs to use the new stream feature. Misc: - Adds helper function to generate a memory config stream read payload. - Adds support in the Stream Receiver to cancel a started stream receive. This is needed when the memory config datagram is rejected. To support this, the StreamReceiver state flow has to keep track of when it sleeps. - Fixes bugs in the stream sender; the registration was not removed for stream proceed. - Adds an API to StreamTransport to allocate identifiers for stream DIDs. These are static, i.e., they are expected to be taken once per instantiated object and not change over time. - Adds API on SimpleStack to instantiate the stream support components. When this API is called, the StreamTransportCan object is created, and the MemoryConfigStreamHandler is added. If the API is not called, this code is not linked into the binary at all (it's about 6k extra flash on a CM4). - Adds a new bit in the memory config Options Read reply to indicate that stream reads are available. Auto-detects this based on whether the extra objects are instantiated or not. - Adds a link-time constant for how many stream senders to instantiate. - Switches dynamic_cast<> to static_cast<> because we build application binaries with -fno-rtti. === * Adds API for stream-based clients. Adds a subclass for stream aware memcfg client. * Implements stream reads in the memory config stream client. * Adds an API to allocate a new receive stream ID in a semi-static manner. * Fix incorrect comment. * Invokes the client progress callback. * Adds test case with error in the memory config datagram. * Fixes bugs in client. Adds a (working) endtoend test with memcfg client. * Adds an e2e test for an error (which crashes). * Adds a (successful) erroneous read example. * Adds a non-working error example. * Adds cancellation support to the stream receiver. This is needed in the memory config interactions: we have to set up the stream receiver before sending the read request datagram to the remote, but the read request might fail without ever opening the stream, so the stream receiver ends up waiting forever. * Cleans up stream state after a memory config datagram receive error happens. * Ensures we don't go to sleep when a cancellation is pending. * Fix whitespace. * Adds unit tests for the callbacks. * Adds a definition for stream read command availability. * Adds stream support features to simplestack. * Switchesfrom dynamic_cast<> to static_cast<> because we build applications with -fno-rtti. * Fixes an incorrect comment. * Fixes some compilation bugs. * Adds a helper function for GDB.
- Loading branch information