我一直在使用javax.cardio包來從我的Nexus S通過ACR122U接收NDEF消息。我創建了一個Android Beam應用程序,它發送一個簡單的文本「Hello!」當意圖過濾NDEF_DISCOVERED標記時。當使用TgGetData(0x86可以)命令我似乎得到:試圖使用ACR122連接到com.android.npp,但得到錯誤說[NFCSTATUS_INVALID_STATE]
NfcP2pLinkManager(7588): Sending ndef via SNEP
NFC JNI(7588): Socket not connected
NFC JNI(7588): LLCP Link deactivated
NFC JNI(7588): LLCP Connect request failed
NfcService(7588): LLCP Link Deactivated message. Restart polling loop.
NFC JNI(7588): phLibNfc_Llcp_Close() returned 0x0001[NFCSTATUS_INVALID_PARAMETER]
NfcP2pLinkManager(7588): Failed to connect over SNEP, trying NPP
NdefPushClient(7588): about to create socket
NfcP2pLinkManager(7588): LLCP deactivated.
NdefPushClient(7588): about to connect to service com.android.npp
NFC JNI(7588): phLibNfc_Llcp_ConnectByUri() returned 0x0011[NFCSTATUS_INVALID_STATE]
NdefPushClient(7588): couldn't send tag
NdefPushClient(7588): exception:
NdefPushClient(7588): java.io.IOException
NdefPushClient(7588): at
com.android.nfc.nxp.NativeLlcpSocket.connectToService(NativeLlcpSocket.java:47)
我下面的ACR122的APDU工作流程基本上是:
1) TgInitAsTarget = 0xD4, 0x8c
2) TgGetData = 0xD4, 0x86
3) TgSetData = 0xD4, 0x85, 0x81
4) TgGetData = 0xD4, 0x86
有誰知道爲什麼我不能連接到「 com.android.npp「服務的Nexus S?
請你可以複製/粘貼你的通信的所有字節序列?我花了一個星期的時間嘗試從我的手機發送一個NDEF消息到我的ACR122U閱讀器,但一直不可能:( – OverMind 2017-03-06 14:07:17
@OverMind,因爲我從這個項目中移除了,我不再有這些序列了,我會快速瀏覽我的檔案找到它們,當時我正在研究Nexus S,因此這些序列對於您的手機和/或操作系統可能不一定相同。 – codedawg82 2017-03-07 22:15:49