larsd
larsd

Reputation: 75

Writing NDEF messages using sendMiFareCommand in CoreNFC

We are using the new NFC write functionality of iOS 13 to write data to a MiFare Ultralight NFC-tag, and it's working perfectly using the writeNDEF method

But as we are using the password protection feature of the NFC-tag we need to send the send the NDEF messages via the lowlevel method sendMiFareCommand

We have not been able to find any documentation for how to transform the NDEF format into the lowlevel data needed for the sendMiFareCommand-method

Any example or documentation on this for Swift would be greatly appreciated.

Upvotes: 0

Views: 1326

Answers (1)

Alec O
Alec O

Reputation: 1707

You might consider first unlocking the tag with a specific MIFARE command and then using the tag.writeNDEF() function on that. This can be accomplished in the same NFC Tag Session without terminating it. This will keep the tag unlocked in the meantime. Review the Ultralight data sheet for instructions on PWD_AUTH. Code is 0x1B for Ultralight EV1 and newer. Section 1.8, page 30 shares instructions on specific use. https://www.nxp.com/docs/en/data-sheet/MF0ULX1.pdf

Upvotes: 1

Related Questions