Skip to content

feat(standalone): add standalone modes#432

Open
nieldk wants to merge 10 commits into
RfidResearchGroup:mainfrom
nieldk:standalone
Open

feat(standalone): add standalone modes#432
nieldk wants to merge 10 commits into
RfidResearchGroup:mainfrom
nieldk:standalone

Conversation

@nieldk
Copy link
Copy Markdown
Contributor

@nieldk nieldk commented May 24, 2026

Adds a pluggable framework for running workflows on the device without a
connected host. Configure once over USB/BLE, arm with a both-button chord,
capture/operate using physical buttons, retrieve results when reconnected.

  • authtrace, multi-session HF14A reader-side auth-trace capture. Thin
    wrapper over the existing CMD 2017 machinery; cmd_processor_hf14a_auth_trace
    is refactored to expose hf14a_auth_trace_run() as a reusable function.

  • slot_cycle, timed emulation-slot rotation. Reference implementation
    for the standalone_mode_iface_t contract; no tag interaction.

  • Chord vocabulary only. Single-button A/B short/long is already owned by
    SettingsButtonFunction (CycleSlot, CloneIcUid, etc.).
    Standalone uses both-short (primary), both-long (arm/disarm toggle),
    both-vlong (destructive).

  • Pre-existing button bug fixed as a side effect. The GPIOTE handler
    shares a single debounce timer between buttons A and B; when both change
    state within the ~50ms debounce window, only the second event's flag gets
    updated. Latent bug, no upstream feature exercised simultaneous-press.
    Fixed in timer_button_event_handle via a rescue path that samples the
    other pin's level after the per-pin code. Single-button behavior
    unchanged. .

  • FDS file ID 0x1010, state at key 0x0001, per-mode config at
    0x0100 + mode_id. No collision with existing IDs.

  • Mode IDs are persistedSTANDALONE_MODE_* enum values must be
    appended, not renumbered.

  • CMD IDs 7000–7006 for the seven host commands. Clean range above
    the existing 6005.

  • STANDALONE_FLAG_HOST_OPTED_IN gates modes with destructive
    capabilities. Reserved for future autoclone/read_replay; neither shipped
    mode needs it.

Verified on Ultra v2.1.0:

  • chord-based arm/disarm and capture
  • device-button session capture (not just CLI trigger)
  • FDS persistence across reboots
    authtrace sessions against a MIFARE Classic 1K

Three reserved mode IDs (autoclone, read_replay, dict_check) are
declared but not implemented.

nieldk added 8 commits May 15, 2026 12:57
Fix indentation in exception handling block and remove commented-out code.
Pluggable framework letting the device run workflows without a
connected host - arm with both-button chord, single-button
SettingsButtonFunction config unaffected. Persists selected mode and
per-mode config in FDS (file 0x1010). Seven host commands at CMD
7000-7006 plus a 'standalone' CLI subgroup.

First two modes:
  - authtrace: multi-session HF14A reader auth-trace capture,
    thin wrapper over the existing CMD 2017 machinery (refactored
    to expose hf14a_auth_trace_run() for reuse)
  - slot_cycle: timed emulation-slot rotation, no tag interaction

WIP - testing locally before splitting into atomic commits for PR.
…quires the RC522. Framework, slot_cycle, and CLI all build clean on Lite; attempting to select authtrace on Lite returns STATUS_PAR_ERR at runtime.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 24, 2026

Built artifacts for commit 5aaf62b

Firmware

Client

nieldk added 2 commits May 24, 2026 15:59
Added descriptions for arm, trigger, and disarm gestures.
- CONTRIBUTING_STANDALONE.md: developer guide covering step-by-step
  mode registration, callback contract, hardware constraints (antenna
  ownership, FDS alignment, Lite compatibility), and a testing checklist.

- mode_template.c: copy-and-fill skeleton for new modes with inline
  TODO markers and design rule documentation.
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