Conversation
7fda857 to
f4c24d4
Compare
Event-driven WebHID driver for the Lego Dimensions portal with NTAG213 reading (PWD_AUTH), vehicle ID lookup from plaintext pages, and a 3-pad scanner UI. Character IDs remain encrypted (UID only). Sources: Ellerbach/LegoDimensions (MIT), AlinaNova21/node-ld (ISC)
The Toy Pad's READ command args were documented as [mode, tagIndex, page] in the reference projects we copied from; the actual order is [mode, page, tagIndex]. With the wrong order, the portal silently returns pages 0-3 regardless of the requested page — so the driver had literally never been reading real NTAG213 content past page 3, just pages 0-3 repeated 11x and labeled a "character." Correcting the order yields genuine 180-byte NTAG213 dumps with unique CRCs per tag. While here, make the scanner actually useful for non-Lego tags: - Classify tags using the marker byte from the portal's 0x56 event: NTAG (Lego), MIFARE Classic Disney, foreign MIFARE, 4-byte MIFARE. Non-Lego tags short-circuit with device-agnostic messages instead of being labeled as Lego characters. - Validate the returned page-0 UID against the anti-collision UID, because the portal doesn't reliably honor tagIndex when multiple tags are on the pad — it returns data for whichever tag its NFC controller happens to be locked onto. Mismatches now show "another tag on the portal is blocking this read" instead of silently presenting another tag's bytes. - Clear the failed-UID cache when a non-NTAG tag is removed, so a Disney tag being lifted off unblocks NTAG tags that had been failing via NFC coexistence. - Display the UID in the error state. - Tighten the portal-command msg-id range to 0x20..0x7F so late auto-read responses (which the portal sends with IDs starting at 0x86) can't masquerade as our outstanding READ. Plus a top-of-file TODO block in the driver cataloguing the known limitations that weren't fixed in this pass: no multi-tag addressing, Disney coexistence poisoning NTAG reads, unverified PWD_AUTH arg order, leaked HID listener on reconnect, no auto- retry after coexistence clears, Amiibo content not read.
f4c24d4 to
85fbf38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sources
Test plan