Repository navigation
v1.2.0 — configuration without source edits, AID at runtime, adoption aliases
Configuration without touching source
Everything in src/Rc522HceConfig.h is #ifndef-guarded, so a build flag always wins, a board preset applies when you do not override, and defaults apply otherwise — for default-constructed readers too, so Rc522HceReader radio; is always correctly wired.
-DRC522HCE_SS_PIN / RST / SCK / MISO / MOSI— wiring per build flag-DRC522HCE_AID_BYTES=0xF0,…— the AID your phone app serves-DRC522HCE_DEBOUNCE_MS,-DRC522HCE_REINIT_INTERVAL_MS,-DRC522HCE_HCE_SETTLE_MS- Board presets auto-detected: ESP32, AVR (Mega/UNO-Nano), ESP8266, RP2040, STM32 — opt out with
-DRC522HCE_NO_BOARD_PRESET
This closes the silent-wrong-pins trap: a reader used on a non-default board is wired by the preset or your flags, never by a DevKit default.
AID at runtime
reader.setAid(bytes, len) changes the AID the reader SELECTs with no reflash (1..11 bytes, rejected otherwise); selectedAid()/selectedAidLen() reports what a phone must serve. buildSelectAidWith() builds the frame for an explicit AID, and NfcReader carries aid()/aidLen()/setAid() so every transport exposes the same surface.
Adoption aliases
Optional CompatNames.h for dropping this into an existing codebase: Presence::Rc522NfcReader, Presence::Hce::*, Presence::HceProof, Presence::Signer::toHex become exact aliases of the same types, so existing call sites keep compiling and values cross the seam both ways. Included by no other header, so it cannot become a hidden dependency; Arduino-only aliases are guarded so it still compiles in host tests.
Also
TsLog.his now part of the library (timestampedPrintdecorator for the diagnostics sink).- 95 host tests (was 86): new suite pins the config defaults, board-preset/pin invariants, AID override and length limits, and the alias layer's type identity.
- CI: self-contained (no third-party actions) — installs PlatformIO Core into a venv, runs
pio test -e native, cross-compiles both examples on ESP32 and AVR Mega, and compiles a build-flag-rewired ESP32-CAM sketch to prove config needs no source edits.