34 Commits

Author SHA1 Message Date
Robin Krahl
dd8d25232b Release ctaphid-dispatch v0.3.0
This release makes Dispatch generic over the buffer size.
0.3.0
2025-03-21 18:58:32 +01:00
Robin Krahl
9a92c88a3b dispatch: Make Dispatch generic over buffer size
The fixed buffer size can be problematic for some use cases, see:
- https://github.com/trussed-dev/ctaphid-dispatch/pull/15

To avoid adding support for different buffer sizes to the crate, we can
just make the dispatch implementation generic over the buffer size.  For
simple cases, a type alias is provided using the old buffer size.
2025-03-21 18:58:31 +01:00
Robin Krahl
e638d27fb8 Add missing log-trace feature
This fixes a new compiler warning.
2025-03-21 18:58:20 +01:00
Robin Krahl
20017616a7 Release ctaphid-dispatch v0.2.0 0.2.0 2025-01-08 18:23:40 +01:00
Robin Krahl
753fec94e1 Cleanup ctaphid-dispatch API
This patch flattens the public API of ctaphid-dispatch by making the
dispatch and types modules private and re-exporting the relevant types
from the root and removes unnecessary re-exports of the types defined by
ctaphid-app.
2025-01-08 18:23:39 +01:00
Robin Krahl
98b846ca2f Release ctaphid-app v0.1.0 app-v0.1.0 2025-01-08 18:22:00 +01:00
Robin Krahl
5a2864c76f Release ctaphid-app v0.1.0-rc.1 app-v0.1.0-rc.1 2025-01-08 09:41:01 +01:00
Robin Krahl
1b973c0c8b Use published trussed-core 2025-01-08 09:40:23 +01:00
Robin Krahl
871f0930ea Remove unused ShortMessage type 2025-01-07 19:30:01 +01:00
Robin Krahl
4b359ee7bf Replace heapless dependency with heapless-bytes 2025-01-07 19:29:19 +01:00
Robin Krahl
adb51a2bf8 Make App trait generic over response size
The buffer size is an implementation detail of the dispatch
implementation.  Applications should not depend on it.  This patch makes
the App trait generic over the response size and changes the request
argument to use a slice instead of a reference to a heapless::Vec.

If applications need a minimum response size, they can still use a
const assertion to enforce it.
2025-01-04 12:41:22 +01:00
Robin Krahl
21f09314d1 Extract App trait into ctaphid-app
Applications don’t need to depend on the dispatch implementation.  They
only need the App trait.  This patch moves the trait into a separate
crate.
2025-01-04 12:34:44 +01:00
Robin Krahl
59288fdb14 Replace trussed dependency with trussed-core 2025-01-03 19:57:00 +01:00
Robin Krahl
910c207994 Fix clippy lints 2025-01-02 22:43:14 +01:00
Robin Krahl
2b1aa2c0da Add CI workflow 2025-01-02 22:37:36 +01:00
Robin Krahl
94c97223ba Optimize stack usage of Dispatch::poll
Dispatch::poll has to copy the request so that the app can write the
response to the interchange.  Previously, we called
Responder::take_request to obtain the message out of the interchange.
This implementation had a stack usage of 15280 bytes while the message
size is only 7609 bytes.

With this patch, we only request a reference from the responder and
manually copy the message to a buffer.  This reduces the stack size to
7664 bytes.

I have no idea why the take_request implementation creates an additional
copy of the message.  But as this function is the root for all CTAPHID
commands, this means we can save around 7 kB stack virtually everywhere.
Similar optimizations may be possible in other functions too.
2023-10-25 15:02:10 +02:00
Sosthène Guédon
57cb331787 Use merged PR 2023-06-20 17:31:45 +02:00
Sosthène Guédon
6f7282bb80 Use released ref-swap 2023-06-20 17:31:45 +02:00
Sosthène Guédon
67534037c6 Add request interrupt mechanism 2023-06-20 17:31:45 +02:00
Sosthène Guédon
d9eb980da1 Remove outdated comment 2023-06-20 16:14:44 +02:00
Sosthène Guédon
5bd06a9dab Add Channel helper types 2023-06-20 16:14:44 +02:00
Sosthène Guédon
2271147b3b Add lifetime to dispatch struct 2023-06-20 16:14:44 +02:00
Sosthène Guédon
4a9651c229 Migrate to interchange 0.3.0 2023-06-20 16:14:44 +02:00
Sosthène Guédon
688df745bd Fix compilation 2023-06-06 11:25:27 +02:00
Sosthène Guédon
cd9e7d0a61 Fix use of AcknowledgeCancel on invalid states
CancelingRequested and CancelingBuildingResponse can't be acknowledged
2023-05-31 14:59:29 +02:00