Skip to content

feat: add IDTECK PSK1 and PAC/Stanley tag type support#844

Open
matteoscrugli wants to merge 2 commits intoGameTec-live:mainfrom
matteoscrugli:feature/lf-pac-idteck
Open

feat: add IDTECK PSK1 and PAC/Stanley tag type support#844
matteoscrugli wants to merge 2 commits intoGameTec-live:mainfrom
matteoscrugli:feature/lf-pac-idteck

Conversation

@matteoscrugli
Copy link
Copy Markdown
Contributor

Summary

Adds GUI support for two LF tag types: PAC/Stanley (TAG_TYPE_PAC = 150) and IDTECK PSK1 (TAG_TYPE_IDTECK = 310). Both follow the same Viking integration pattern (raw-hex UID, no parsed format fields).

This consolidates the previously-opened separate PRs (one per tag type) into a single change set after maintainer feedback noting that merging similar parallel branches creates merge conflicts. Now bundled in one commit per type for review clarity, but no inter-PR conflicts.

Motivation

Changes

helpers/definitions.dart

  • New TagType entries: pac(150), idteck(310)
  • New ChameleonCommand entries:
    • PAC: scanPacTag(3014), writePacToT5577(3015), setPacEmulatorID(5006), getPacEmulatorID(5007)
    • IDTECK: writeIdteckToT5577(3017), setIdteckEmulatorID(5010), getIdteckEmulatorID(5011)
  • New PacCard, IdteckCard classes (modeled on VikingCard)

bridge/chameleon.dart

  • readPac, setPacEmulatorID, writePacToT55XX, getPacEmulatorID
  • setIdteckEmulatorID, writeIdteckToT55XX, getIdteckEmulatorID
  • No readIdteck — PSK demodulation is not implemented in the firmware yet.

helpers/general.dart

  • Display names: "PAC/Stanley" (matches firmware CLI), "IDTECK"
  • LF tag-types list extended
  • getLFCardFromUID factory and uidSizeForLfTag (PAC = 8, IDTECK = 8 bytes)

helpers/write.dart, helpers/t55xx/write/base.dart

  • Route PAC and IDTECK through the existing T55xx write helper. PAC does read-back verification; IDTECK skips it because the firmware has no PSK1 read path yet — assumes success if the firmware command did not raise an error.

gui/page/slot_manager.dart, gui/menu/dialogs/slot/edit.dart, gui/menu/dialogs/slot/export.dart, gui/page/read_card.dart

  • Branches to save a CardSave into a slot, load/save the emulator ID in the slot edit dialog, export the slot back to a CardSave, and include PAC in the LF reader scan chain.

gui/page/home.dart

  • Bump the firmware capability gate from setIoProxEmulatorID to setIdteckEmulatorID, the highest-numbered command this PR introduces.

Dependencies

This PR depends on RfidResearchGroup/ChameleonUltra#407 (IDTECK firmware). Merging before that firmware ships would cause the capability check to fail against current released firmware builds. Therefore opened as draft until firmware #407 lands.

PAC alone would be mergeable today (firmware already upstream), but separating it out would re-introduce the merge-conflict friction that motivated this consolidation.

Testing

  • flutter analyze lib/ clean (only pre-existing issues unrelated to this PR)
  • flutter build macos --debug succeeds
  • Tested live against a Chameleon Ultra running the firmware branch from Visualize found keys when reading card. #407 (BLE and USB):
    • Slot with TAG_TYPE_IDTECK renders as "IDTECK" (was "unknown")
    • Loading a saved IDTECK card into a slot writes the emulator ID and emulates correctly against a real IDTECK reader
    • Editing an IDTECK slot round-trips the frame through get/set
    • Exporting a slot to a CardSave preserves the frame
    • T5577 clone via the Write Card flow succeeds end-to-end: frame programmed on a blank T5577, accepted by the reader
  • No regressions on the other LF types (EM410x / HIDProx / Viking / ioProx)
  • PAC is exercised by the same code paths as the Viking pattern; live device test pending a real PAC card

Pattern

Implementation follows the Viking integration 1:1 (simplest existing LF tag with raw-hex UID) and mirrors the structure of the recently-merged ioProx PR (#841). Same file touches, same else-if chain placement.

Adds IDTECK to the supported LF protocols on the GUI side, matching
the firmware support added upstream.

- TagType.idteck (310) in the PSK range, matching the firmware enum
- IdteckCard model (8-byte 64-bit frame: 32-bit preamble + 32-bit payload)
- ChameleonCommand entries: writeIdteckToT5577 (3017),
  setIdteckEmulatorID (5010), getIdteckEmulatorID (5011)
- Bridge RPC wrappers following the Viking pattern
- Wired into the LF type list, display name, card factory, and slot
  manager "add card" flow, plus the T55xx write helper
- uidSizeForLfTag returns 8 for IDTECK

No read path: firmware-side PSK demodulation is not implemented yet
(the tag-emulation ADC is envelope-only at 125kHz), so the GUI does
not expose a "read IDTECK" action. Emulation and T55xx clone work.

Depends on firmware PR GameTec-live#407 landing for the command IDs.
@matteoscrugli matteoscrugli force-pushed the feature/lf-pac-idteck branch from 592921d to aaac5e2 Compare April 27, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant