我在 Arduino Uno 上的 PN532 与运行 Kitkat 4.4.2 的 Nexus 7 之间进行通信,
我从这里获得的 HCE 程序:
https
://github.com/grundid/host-card-emulation-sample
我在 Nexus 7 上运行示例程序,在 Arduino 上我尝试发送 APDU 命令:
uint8_t PN532::APDU ()
{
uint8_t message[] = {
0x00, /* CLA */
0xA4, /* INS */
0x04, /* P1 */
0x00, /* P2 */
0x07, /* Lc */
0xF0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x00 /* Le */ };
/* Prepare the first command */
/* Send the command */
if (HAL(writeCommand)(message, 13)) {
Serial.println(F("Go here 1"));
return 0;
}
Serial.println(F("Go here 2"));
/* Read the response packet */
return (0 < HAL(readResponse)(message, sizeof(message)));}
这是我的 APDU 服务文件:apduservice.html
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/servicedesc"
android:requireDeviceUnlock="false" >
<aid-group
android:category="other"
android:description="@string/aiddescription" >
<aid-filter android:name="F0010203040506" />
</aid-group>
但我无法从 Nexus 7 得到任何响应,并且从 Nexus 7 我也没有记录任何信号?有谁知道我在这里想念什么?谢谢