Skip to content

Feat/sat device uptime decrypt#40

Merged
buckleypaul merged 3 commits into
mainfrom
feat/sat-device-uptime-decrypt
Jun 15, 2026
Merged

Feat/sat device uptime decrypt#40
buckleypaul merged 3 commits into
mainfrom
feat/sat-device-uptime-decrypt

Conversation

@buckleypaul

Copy link
Copy Markdown
Collaborator

No description provided.

sat scan --key now decrypts both UNIX_TIME (day-based) and DEVICE_UPTIME
(0-127 counter pool) satellite packets. decrypt_satellite() gains a
counter_mode param mirroring decrypt(); the shared validation is factored
into _normalize_counter_mode().

The CLI auto-detects the counter source when --key is given without
--counter-mode (trying UNIX_TIME then DEVICE_UPTIME, caching the resolved
mode for the stream) and announces it, mirroring ble scan. A --counter-mode
option forces a mode and skips detection, with the same DEVICE_UPTIME
requires-key / mutually-exclusive-with-days guards as ble scan.
…atellite

The BLE and satellite scan paths each carried a verbatim copy of the
UNIX_TIME/DEVICE_UPTIME detect → cache → announce loop, plus the
"days only applies to UNIX_TIME" kwargs rule duplicated four times.

Extract one core, _detect_ctr_counter_mode(), that owns the loop and the
kwargs rule. Each path now passes a one-line packet-bound decrypt_fn adapter
(decrypt vs decrypt_satellite) and a cache key (BLE EID, or a per-stream
sentinel for satellite, since satellite packets have no EID). cache_key=None
disables caching for EID-less BLE packets, preserving prior behavior.

Behavior is unchanged; existing CLI tests cover both paths.
…e guard

counter_mode defaults to UNIX_TIME, so `counter_mode == DEVICE_UPTIME` already
implies the user passed the flag explicitly. Removing the redundant
`_explicit("counter_mode")` conjunct makes the satellite guard match the
ble scan/detect guards exactly, eliminating cross-command drift.

No behavior change.
@buckleypaul buckleypaul merged commit 4842902 into main Jun 15, 2026
2 checks passed
@buckleypaul buckleypaul deleted the feat/sat-device-uptime-decrypt branch June 15, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant