Skip to content

fix: EM410x load-from-saved-card UID length - #939

Open
bettythegoodboi wants to merge 1 commit into
GameTec-live:mainfrom
bettythegoodboi:pr/em410x-load-saved-card
Open

fix: EM410x load-from-saved-card UID length#939
bettythegoodboi wants to merge 1 commit into
GameTec-live:mainfrom
bettythegoodboi:pr/em410x-load-saved-card

Conversation

@bettythegoodboi

Copy link
Copy Markdown

Summary

  • Fix EM410x load-from-saved-card: firmware set_emu_id expects exactly 5 (or 13 Electra) bytes
  • Older saves / scan payloads sometimes stored type(u16)+uid (7 bytes), so load failed with PAR_ERR while manual 5-byte entry worked
  • Normalize UID on load, save, create/edit, Flipper import, and T55xx write
  • Map EM410x 16/32/64 reader clock types to base EM410X for slot emulation (firmware only emulates base / Electra)

Test plan

  • Read EM410x, save card, load onto slot → emulate works
  • Manual 5-byte UID entry still works
  • Legacy saved card with 7-byte type-prefixed UID loads correctly
  • flutter test test/em410x_uid_test.dart

Firmware set_emu_id requires exactly 5 bytes (or 13 for Electra) and
only accepts slot types EM410X / EM410X_ELECTRA. Older saves and scan
payloads sometimes stored type(u16)+uid, so load-to-slot sent 7 bytes
and silently failed (PAR_ERR), while manual 5-byte entry worked.

- normalizeEm410xUid strips type prefix / enforces length
- map EM410x 16/32/64 to base EM410X for emulation
- normalize on save, load, create/edit, Flipper import, T55xx write
- surface set_emu_id errors instead of ignoring status
- unit tests for legacy and clean UID paths
@GameTec-live

Copy link
Copy Markdown
Owner

For reference: How much of this is AI and did you manually test and review the code?

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.

3 participants