首页 > 解决方案 > PN532 - 标签仿真问题 - Java/Raspberry Pi

问题描述

我已经使用 SPI 成功地将 PN532 连接到 RPi。沟通工作。我可以使用IN_LIST_PASSIVE_TARGET. 命令喜欢GET_FIRMWARE_VERSIONSAM_CONFIGURATION按预期工作。

现在,我正在尝试模拟NDEF 标记类型 4。我创建了一条带有文本记录的 NDEF 消息,文本为“ABCD”。NDEF 没问题,因为我已经使用 nfc-tools -> 进行了验证nfc-emulate-forum-tag4

我正在尝试通过 iOS 应用程序读取此模拟标签。

使用nfc-emulate-forum-tag4时,它按预期工作。iOS 应用程序从仿真标签中读取“ABCD”消息。

但是,当我尝试使用我的实现(Java/Pi4J)时,什么也没有发生。iOS 无法读取仿真标签,也无法收到任何错误。它一直显示标准的 NFC 对话框。

我的实现与 PN532 交换的字节nfc-emulate-forum-tag4与. 然而,我错过了一些东西。

请注意,nfc-emulate-forum-tag4输出并未显示 TG_INIT_AS_TARGET 是如何指定的。一旦发起者识别,它只显示数据交换。

我用于实现的参考库: https ://github.com/elechouse/PN532

NDEF 文件内容:

0xD1
0x01
0x07
0x54
0x02
0x65
0x6E
0x41
0x42
0x43
0x44

nfc-emulate-forum-tag4清单(作品):

pi@raspberrypi:~/tmp $ nfc-emulate-forum-tag4 ABCD.ndef
NFC device: PN532_via_SPI opened
Emulating NDEF tag now, please touch it with a second NFC device
    In: 00  a4  04  00  07  d2  76  00  00  85  01  01  00
    Out: 90  00
    In: 00  a4  00  0c  02  e1  03
    Out: 90  00
    In: 00  b0  00  00  0f
    Out: 00  0f  20  00  54  00  ff  04  06  e1  04  ff  fe  00  00  90  00
    In: 00  a4  00  0c  02  e1  04
    Out: 90  00
    In: 00  b0  00  00  02
    Out: 00  0b  90  00
    In: 00  a4  00  0c  02  e1  04
    Out: 90  00
    In: 00  b0  00  00  0b
    Out: 00  0b  d1  01  07  54  02  65  6e  41  42  90  00
    In: 00  b0  00  0b  02
    Out: 43  44  90  00
nfc_emulate_target: Target Released

==================================================== ==============

我的实现清单(不起作用):

pi@raspberrypi:~/tmp $ java -jar pn532_java-1.0.jar
Reset PN532 used pins to system default state
--> Initializing PN532
--> IRQ pin initial state: HIGH
--> GPIO IRQ LISTENER USED
--> PN532 End of initialization
====================================================================================================
-->
COMMAND: Get_Firmware_Version
--> PN532.writeCommand([0x02])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0x2A
--> PN532.writeByte: 0x00
--> PN532.waitForAck()
--> PN532.checkSpiAck()
--> RPi - IRQ pin received signal: LOW
--> PN532.writeByte: 0x03
--> ACK reading...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 12, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x06
--> PN532.readResponse - data length: 5
--> PN532.readByte: 0xFA
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x03
--> PN532.readByte: 0x32
--> PN532.readByte: 0x01
--> PN532.readByte: 0x06
--> PN532.readByte: 0x07
--> PN532.readByte: 0xE8
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
Found a chip PN532
Firmware version: 1.6
====================================================================================================
-->
COMMAND: SAM_Configuration
--> PN532.writeCommand([0x14 0x01 0x14 0x01])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x05
--> PN532.writeByte: 0xFB
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x14
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x14
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 8, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x02
--> PN532.readResponse - data length: 1
--> PN532.readByte: 0xFE
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x15
--> PN532.readByte: 0x16
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
SAM configuration: true
====================================================================================================
-->
COMMAND: Get_General_Status
--> PN532.writeCommand([0x04])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0x28
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x06
--> PN532.readResponse - data length: 5
--> PN532.readByte: 0xFA
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x05
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x80
--> PN532.readByte: 0xA6
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
GENERAL STATUS: 0x00 0x00 0x00 0x80
====================================================================================================
Waiting for an ISO14443A Card ...
====================================================================================================
================== NDEF FILE START ==================
0xD1
0x01
0x07
0x54
0x02
0x65
0x6E
0x41
0x42
0x43
0x44
================== NDEF FILE END ==================
-->
COMMAND: Tg_Init_As_Target
--> PN532.writeCommand([0x8C 0x05 0x04 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x27
--> PN532.writeByte: 0xD9
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8C
--> PN532.writeByte: 0x05
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x20
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x77
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x05
--> PN532.readResponse - data length: 4
--> PN532.readByte: 0xFB
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8D
--> PN532.readByte: 0x08
--> PN532.readByte: 0xE0
--> PN532.readByte: 0x80
--> PN532.readByte: 0x36
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
=====================
TAG EMULATION STARTED
=====================
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x10
--> PN532.readResponse - data length: 15
--> PN532.readByte: 0xF0
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x04
--> PN532.readByte: 0x00
--> PN532.readByte: 0x07
--> PN532.readByte: 0xD2
--> PN532.readByte: 0x76
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x85
--> PN532.readByte: 0x01
--> PN532.readByte: 0x01
--> PN532.readByte: 0x00
--> PN532.readByte: 0x26
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x04
P2: 0x00
LC: 0x07
P1-P2-LEN: 0x00
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_NAME
SUPPORTED
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x0A
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x03
--> PN532.readByte: 0x0E
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> CC
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x08
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0F
--> PN532.readByte: 0xE5
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x0F
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
SEND COMPATIBILITY CONTAINER
-->
COMMAND: Tg_Set_Data - data size: 17
--> PN532.writeCommand([0x8E 0x00 0x0F 0x20 0x00 0x54 0x00 0xFF 0x04 0x06 0xE1 0x04 0xFF 0xFE 0x00 0x00 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x13
--> PN532.writeByte: 0xED
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0F
--> PN532.writeByte: 0x20
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x54
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xE1
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xA0
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x0A
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x04
--> PN532.readByte: 0x0D
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> NDEF
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x08
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x02
--> PN532.readByte: 0xF2
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x02
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 4
--> PN532.writeCommand([0x8E 0x00 0x0B 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xFA
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0B
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x03
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x0A
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x04
--> PN532.readByte: 0x0D
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> NDEF
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x08
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0B
--> PN532.readByte: 0xE9
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x0B
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 13
--> PN532.writeCommand([0x8E 0x00 0x0B 0xD1 0x01 0x07 0x54 0x02 0x65 0x6E 0x41 0x42 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x0F
--> PN532.writeByte: 0xF1
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0B
--> PN532.writeByte: 0xD1
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x07
--> PN532.writeByte: 0x54
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0x65
--> PN532.writeByte: 0x6E
--> PN532.writeByte: 0x41
--> PN532.writeByte: 0x42
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x7E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> RPi - IRQ pin received signal: LOW
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x86
--> PN532.writeByte: 0xA6
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x08
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0B
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE7
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0B
LC: 0x02
P1-P2-LEN: 0x0B
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 4
--> PN532.writeCommand([0x8E 0x43 0x44 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xFA
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x43
--> PN532.writeByte: 0x44
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x87
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8F
--> PN532.readByte: 0x00
--> PN532.readByte: 0x9C
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
TG_SET_DATA response: 2
-->
COMMAND: In_Release
--> PN532.writeCommand([0x52 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x03
--> PN532.writeByte: 0xFD
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x52
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xDA
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x53
--> PN532.readByte: 0x00
--> PN532.readByte: 0xD8
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
Reset PN532 used pins to system default state
pi@raspberrypi:~/tmp $

任何帮助表示赞赏(尤其是我非常绝望)。谢谢!

标签: nfcpn532

解决方案


这是原始问题中列表的简化版本(由于字符限制而作为答案发布)。它从Tg_Init_As_Target.


-->
COMMAND: Tg_Init_As_Target
--> PN532.writeCommand([0x8C 0x05 0x04 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x27
--> PN532.writeByte: 0xD9
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8C
--> PN532.writeByte: 0x05
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x20
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x77
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> PN532.checkSpiAck()
--> PN532.writeByte: 0x03
--> ACK reading...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x05
--> PN532.readResponse - data length: 4
--> PN532.readByte: 0xFB
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x8D
--> PN532.readByte: 0x08
--> PN532.readByte: 0xE0
--> PN532.readByte: 0x80
--> PN532.readByte: 0x36
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
=====================
TAG EMULATION STARTED
=====================
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 15
--> PN532.readByte: 0xF0
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x04
--> PN532.readByte: 0x00
--> PN532.readByte: 0x07
--> PN532.readByte: 0xD2
--> PN532.readByte: 0x76
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x85
--> PN532.readByte: 0x01
--> PN532.readByte: 0x01
--> PN532.readByte: 0x00
--> PN532.readByte: 0x26
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x04
P2: 0x00
LC: 0x07
P1-P2-LEN: 0x00
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_NAME
SUPPORTED
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x03
--> PN532.readByte: 0x0E
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> CC
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0F
--> PN532.readByte: 0xE5
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x0F
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
SEND COMPATIBILITY CONTAINER
-->
COMMAND: Tg_Set_Data - data size: 17
--> PN532.writeCommand([0x8E 0x00 0x0F 0x20 0x00 0x54 0x00 0xFF 0x04 0x06 0xE1 0x04 0xFF 0xFE 0x00 0x00 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x13
--> PN532.writeByte: 0xED
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0F
--> PN532.writeByte: 0x20
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x54
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xE1
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0xFE
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xA0
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x04
--> PN532.readByte: 0x0D
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> NDEF
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x02
--> PN532.readByte: 0xF2
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x02
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 4
--> PN532.writeCommand([0x8E 0x00 0x0B 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xFA
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0B
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x03
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 9
--> PN532.readByte: 0xF6
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xA4
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0C
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE1
--> PN532.readByte: 0x04
--> PN532.readByte: 0x0D
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0C
LC: 0x02
P1-P2-LEN: 0x0C
ISO7816_SELECT_FILE
C_APDU_P1_SELECT_BY_ID
CURRENT FILE --> NDEF
-->
COMMAND: Tg_Set_Data - data size: 2
--> PN532.writeCommand([0x8E 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x04
--> PN532.writeByte: 0xFC
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0B
--> PN532.readByte: 0xE9
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x00
LC: 0x0B
P1-P2-LEN: 0x00
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 13
--> PN532.writeCommand([0x8E 0x00 0x0B 0xD1 0x01 0x07 0x54 0x02 0x65 0x6E 0x41 0x42 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x0F
--> PN532.writeByte: 0xF1
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x0B
--> PN532.writeByte: 0xD1
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x07
--> PN532.writeByte: 0x54
--> PN532.writeByte: 0x02
--> PN532.writeByte: 0x65
--> PN532.writeByte: 0x6E
--> PN532.writeByte: 0x41
--> PN532.writeByte: 0x42
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x7E
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: Tg_Get_Data
--> PN532.writeCommand([0x86])
--> PN532.readResponse - data length: 7
--> PN532.readByte: 0xF8
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x87
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xB0
--> PN532.readByte: 0x00
--> PN532.readByte: 0x0B
--> PN532.readByte: 0x02
--> PN532.readByte: 0xE7
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
P1: 0x00
P2: 0x0B
LC: 0x02
P1-P2-LEN: 0x0B
ISO7816_READ_BINARY
-->
COMMAND: Tg_Set_Data - data size: 4
--> PN532.writeCommand([0x8E 0x43 0x44 0x90 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x06
--> PN532.writeByte: 0xFA
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x8E
--> PN532.writeByte: 0x43
--> PN532.writeByte: 0x44
--> PN532.writeByte: 0x90
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x87
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: HIGH
-->
COMMAND: In_Release
--> PN532.writeCommand([0x52 0x00])
--> PN532.writeByte: 0x01
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xFF
--> PN532.writeByte: 0x03
--> PN532.writeByte: 0xFD
--> PN532.writeByte: 0xD4
--> PN532.writeByte: 0x52
--> PN532.writeByte: 0x00
--> PN532.writeByte: 0xDA
--> PN532.writeByte: 0x00
--> RPi - IRQ pin received signal: LOW
--> PN532.waitForAck()
--> PN532.checkSpiAck()
--> PN532.writeByte: 0x03
--> ACK reading...
--> PN532.readByte: 0x00
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
--> PN532.readResponse - waiting...
--> RPi - IRQ pin received signal: LOW
--> PN532.readResponse(..., 255, 1000)
--> PN532.writeByte: 0x03
--> Read response started...
--> PN532.readByte: 0x00
--> PN532.readByte: 0xFF
--> PN532.readByte: 0x03
--> PN532.readResponse - data length: 2
--> PN532.readByte: 0xFD
--> PN532.readByte: 0xD5
--> PN532.readByte: 0x53
--> PN532.readByte: 0x00
--> PN532.readByte: 0xD8
--> PN532.readByte: 0x00
--> RPi - IRQ pin received signal: HIGH
====================================================================================================
Reset PN532 used pins to system default state
pi@raspberrypi:~/tmp $

推荐阅读