From 4c0b234bce42b2a2844b6122ef2cacf3a27cbd6c Mon Sep 17 00:00:00 2001 From: Sucareto <28331534+Sucareto@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20mifare=20=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E8=A1=8C=E4=B8=BA=EF=BC=8C=E6=84=9F=E8=B0=A2=20gyt4?= =?UTF-8?q?=20=E7=9A=84=E5=B8=AE=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aime_Reader.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Aime_Reader.h b/Aime_Reader.h index 6e924f4..575444d 100644 --- a/Aime_Reader.h +++ b/Aime_Reader.h @@ -169,7 +169,7 @@ typedef union { uint8_t type; uint8_t id_len; union { - uint8_t mifare_uid[4]; + uint8_t mifare_uid[7]; // 可以读取 MIFARE Ultralight,但游戏不支持 struct { uint8_t IDm[8]; uint8_t PMm[8]; @@ -306,8 +306,8 @@ void nfc_stop_polling() { void nfc_card_detect() { uint16_t SystemCode; uint8_t bufferLength; - if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, res.mifare_uid, &res.id_len) && nfc.getBuffer(&bufferLength)[4] == 0x08) { // Only read cards with sak=0x08 - res_init(0x07); + if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, res.mifare_uid, &res.id_len)) { + res_init(res.id_len + 3); res.count = 1; res.type = 0x10; } else if (nfc.felica_Polling(0xFFFF, 0x00, res.IDm, res.PMm, &SystemCode, 200) == 1) {