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

Alan-Jowett / sonde / 24599661568
82%

Build:
DEFAULT BRANCH: main
Ran 18 Apr 2026 07:20AM UTC
Jobs 1
Files 113
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

18 Apr 2026 12:15AM UTC coverage: 80.859% (-0.02%) from 80.877%
24599661568

push

github

web-flow
feat(sht40): migrate to store-and-forward (send_async) (#759)

* feat(sht40): migrate to store-and-forward (send_async)

Migrate the SHT40 BPF sensor program from synchronous \send()\ to
\send_async()\ for store-and-forward delivery. The payload grows from
14 to 22 bytes, prepending \ctx->timestamp\ (LE u64) per the
bpf-environment.md best practice so handlers can correlate measurements
to collection time rather than delivery time.

sht40_sensor.c changes:
- Use \ctx->timestamp\ instead of discarding context
- Prepend 8-byte LE timestamp to payload (22 bytes total)
- Call \send_async()\ with fallback to \send()\ if queue is full

sonde-sht40-handler changes:
- Accept both V1 (14-byte, legacy) and V2 (22-byte, timestamped) payloads
- V2: use embedded collection timestamp for JSON output
- V1: fall back to wall-clock timestamp (backward compatible)
- Add V2 decode test, CRC tests at V2 offsets, wrong-length edge cases

Payload V2 layout:
  [0..7]   timestamp (LE u64, ms since epoch)
  [8..13]  raw frame (T, CRC, RH, CRC)
  [14..17] temp_mC (LE i32)
  [18..21] rh_mpermille (LE i32)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* fix(node): drain async queue before BPF, only on NOP cycles

Move the async queue drain from after BPF execution (step 9b) to the
NOP command branch before BPF execution (step 8a). This ensures:

- Blobs queued by the current cycle's BPF via \send_async\ stay in the
  RTC queue and are piggybacked on the next WAKE — achieving single-TX
  steady state for programs that queue one blob per cycle.
- Previous-cycle blobs not piggybacked (multiple or oversized) are still
  sent as APP_DATA, but only on NOP cycles where there is no other
  radio work to do.
- Non-NOP commands (UpdateProgram, RunEphemeral, UpdateSchedule, Reboot)
  skip the drain — the queue can wait and program updates already clear
  the queue explicitly.

Co-authored-by: Copilot <223556219... (continued)

88 of 112 new or added lines in 2 files covered. (78.57%)

24362 of 30129 relevant lines covered (80.86%)

204.34 hits per line

Uncovered Changes

Lines Coverage ∆ File
22
70.83
0.72% crates/sonde-sht40-handler/src/main.rs
2
87.35
-0.03% crates/sonde-node/src/wake_cycle.rs
Jobs
ID Job ID Ran Files Coverage
1 24599661568.1 18 Apr 2026 07:20AM UTC 113
80.86
GitHub Action Run
Source Files on build 24599661568
  • Tree
  • List 113
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24599661568
  • f21b476c on github
  • Prev Build on main (#24589750296)
  • Next Build on main (#24608179816)
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

© 2026 Coveralls, Inc