• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

google / OpenSK / 10721013571
97%
2.1: 97%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: 2.1
Ran 05 Sep 2024 01:11PM UTC
Jobs 1
Files 38
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Sep 2024 01:07PM UTC coverage: 97.348% (+0.2%) from 97.128%
10721013571

push

github

web-flow
Refactors HID connections to support busy response (#699)

* Refactors HID connections to support busy response

The main intended difference is that OpenSK now responds with ERR_CHANNEL_BUSY
when it receives a packet while waiting for touch in in a CTAP2 command.

To support this more elegantly, we changed `HidConnection` to have a
`send` and `recv` instead of `send_and_maybe_recv` for a cleaner API.
This also resolves an older TODO to respond to incoming channels on
the other USB endpoint.

It doesn't process the incoming traffic correctly, but unblock the host
at least, and tells it to come back later. We still only allow one
active channel at the same time.

We now don't need the `TRANSMIT_AND_RECEIVE` syscall anymore. I didn't
remove it from the Tock pack for simplicity, but cleaned up
libtock-drivers.

The Env API changes from having one connection per endpoint, to having
one send function that takes an endpoint, and a receive function that
receives on all endpoints at the same time.
The `HidConnection` already received on all endpoints before, which was
inconsistent with the existance of, e.g., `VendorHidConnection` being
able to receive on the main endpoint.

Since we now have a cleaner send and receive API, we use this in
`src/main.rs` and simplify it a bit, while making it more consistent
with other calls to the HID API.

I found an additional inaccuracy in our implementation while
refactoring: We want to send keepalives every 100 ms. To do so, we first
wait for a button callback for 100 ms. Then we send the keepalive and
check if a cancel packet appeared. What should have happened instead is
that we listen for HID packets and button presses at the same time
during these 100 ms. If nothing happens that stops the loop, we send the
keepalive.

The old implementation would, in some implementations, wait 200 ms for
each keepalive: First 100 for touch, then 100 for `send_and_maybe_receive`.

The new impleme... (continued)

86 of 111 new or added lines in 4 files covered. (77.48%)

2 existing lines in 2 files now uncovered.

13363 of 13727 relevant lines covered (97.35%)

11173.74 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
90.44
0.52% libraries/opensk/src/env/test/mod.rs
23
97.7
1.0% libraries/opensk/src/ctap/mod.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
97.7
1.0% libraries/opensk/src/ctap/mod.rs
1
90.44
0.52% libraries/opensk/src/env/test/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 10721013571.1 05 Sep 2024 01:11PM UTC 38
97.35
GitHub Action Run
Source Files on build 10721013571
  • Tree
  • List 38
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b562a799 on github
  • Prev Build on develop (#10720769063)
  • Next Build on develop (#10722011523)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc