I am using PhoneGap-NFC with Ionic/Capacitor and am trying to lock a NXP NTAG213.
According to the datasheet (https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf) I have to write to page 0x2B to set the PWD, page 0x2C for the PACK.
const set_password_cmd = Uint8Array.from([
0xA2, //WRITE
0x2B, //address 2B
1, 2, 3, 4//pwd
]);
let res = await nfc.transceive(set_password_cmd);
const set_pack_cmd = Uint8Array.from([
0xA2, //WRITE
0x2C, //address 2C
2, 7, 0, 0//pack
]);
res = await nfc.transceive(set_pack_cmd);
Password should be 1234, pack should be 27.
Problem is I keep getting 0xA (LF) as a response to both commands and the tag does not lock itself.
PS. I am calling .connect(tech) and .close() afterwards inside a addTagDiscoveredListener call, sending a GET_VERSION command works as expected and returns correct data.
question from:
https://stackoverflow.com/questions/65860973/nfc-mifare-ultralight-bogus-response-data 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…