-
Notifications
You must be signed in to change notification settings - Fork 0
RFID Scanners
There are 'old style' Mifare's (Mifare Classic) and 'new style' ones. The wristbands are all new style. Most other RFIDs (oysters and the like), are old style ones.
The old style ones have a UID[4] and are identified by having a tag type that starts with 'Mifare Classic'. To convert these into what the card reader gives:
tag the 4 bytes of the UID, interpret them as little endian, print as decimal, and that's it. No need to map stuff or have lookup tables.
Example: Android says UID[4] = 1c78f2bf. Turn it around byte-by-byte into: 0xBFF2781C, then print that as decimal: 3220338716, and that is exactly what the card readers give you.
The 'new style' ones have a UID[7] and their tag type string starts with Mifare, but not with Mifare Classic. To convert these to what the reader gives you, take the top 3 bytes of the 7-byte UID, turn them around, add hex 88 at the end, and print that as decimal, so, for example, android gives 04c43bc21c2680, first take the top 3 bytes: 04c43b, then flip them: 3bc404, then append 88: 0x3BC40488, then print that as decimal: 1002701960, which is what the card reader returns.
We had one non-wristband new-style RFID at the help desk, and that too worked with the 'append 88' trick as above, so presumably this should work on all of them.