2014-02-12 82 views
0

在我們的項目中,我們試圖在NFC讀卡器ACS ACR122U中模擬ISO14443-3 PICC,並使用NFC手機(Samsung S3或S4)讀取該卡。在S4的情況下,我們可以成功地與模擬卡通信,但在S3的情況下,沒有NFC事件。NFC卡仿真問題S3(Android 4.3)和ACR122U

我們注意到Android(logcat)中的所有命令/響應和日誌,這表明S3無法激活LLCP通信。我發佈了我們所有的數據,請幫助我們解決問題。

命令/響應ACR122u(在讀取器PN532控制器):

COMMAND:FF0000002DD48C0400000000002001FE0FBBBAA6C9890000000000000000FFFF01FE0FBBBAA6C98900000647666D01011000 
RESPONSE:D58D08E080 

COMMAND:FF00000002D486 
RESPONSE:D5870000A4040007D276000085010100 

COMMAND:FF00000004D48E6A82 
RESPONSE:D58F00 

COMMAND:FF00000002D486 
RESPONSE:D5870000A4040007D2760000850100 

COMMAND:FF00000004D48E6A82 
RESPONSE:D58F00 

COMMAND:FF00000002D486 
RESPONSE:D5870000A4040C05A00000000100 (Data we want to send to emulated card from NFC phone) 

響應D58D08E080指示讀卡器仿真爲:

  • ISO/IEC 14443-4 PICC - > YES
  • DEP - >編號
  • 框架類型 - > Mifare

現在,當我們把S4在讀者,我們有以下日誌:

02-10 10:23:13.711: I/BrcmNci(3355): -- 
02-10 10:23:13.711: I/BrcmNci(3355): TX: Type 4 Tag Command (13 bytes) 
02-10 10:23:13.711: I/BrcmNci(3355): CLA:0x00 
02-10 10:23:13.711: I/BrcmNci(3355): INS:0xA4(Select) 
02-10 10:23:13.711: I/BrcmNci(3355): P1:0x04(Name) 
02-10 10:23:13.711: I/BrcmNci(3355): P2:0x00(First or Only) 
02-10 10:23:13.711: I/BrcmNci(3355): Lc:0x07(7) 
02-10 10:23:13.711: I/BrcmNci(3355): Data(7 bytes) 
02-10 10:23:13.711: E/AudioResampler(2497): Unsupported sample format, 1 bits, 2 channels 
02-10 10:23:13.716: I/BrcmNci(3355): 00 : d2 76 00 00 85 01 01 
02-10 10:23:13.716: I/BrcmNci(3355): Le:0x00(0) 
02-10 10:23:13.716: I/BrcmNci(3355): -- 
02-10 10:23:13.716: I/AudioHardwareTinyALSA(2497): AudioStreamOutALSA::write setDevice 

02-10 10:23:13.741: I/BrcmNci(3355): -- 
02-10 10:23:13.741: I/BrcmNci(3355): RX: Type 4 Tag Response (2 bytes) 
02-10 10:23:13.746: I/BrcmNci(3355): SW:0x6A82(Not Found) 
02-10 10:23:13.746: I/BrcmNci(3355): -- 
02-10 10:23:13.746: I/BrcmNci(3355): -- 
02-10 10:23:13.746: I/BrcmNci(3355): TX: Type 4 Tag Command (12 bytes) 
02-10 10:23:13.746: I/BrcmNci(3355): CLA:0x00 
02-10 10:23:13.746: I/BrcmNci(3355): INS:0xA4(Select) 
02-10 10:23:13.746: I/BrcmNci(3355): P1:0x04(Name) 
02-10 10:23:13.746: I/BrcmNci(3355): P2:0x00(First or Only) 
02-10 10:23:13.746: I/BrcmNci(3355): Lc:0x07(7) 
02-10 10:23:13.746: I/BrcmNci(3355): Data(7 bytes) 
02-10 10:23:13.746: I/BrcmNci(3355): 00 : d2 76 00 00 85 01 00 
02-10 10:23:13.746: I/BrcmNci(3355): -- 
02-10 10:23:13.786: I/BrcmNci(3355): -- 
02-10 10:23:13.786: I/BrcmNci(3355): RX: Type 4 Tag Response (2 bytes) 
02-10 10:23:13.786: I/BrcmNci(3355): SW:0x6A82(Not Found) 
02-10 10:23:13.786: I/BrcmNci(3355): -- 

02-10 10:23:14.996: I/BrcmNci(3355): -- 
02-10 10:23:14.996: I/BrcmNci(3355): RX: Type 4 Tag Response (2 bytes) 
02-10 10:23:14.996: I/BrcmNci(3355): SW:0x9000(Command Completed) 
02-10 10:23:14.996: I/BrcmNci(3355): -- 

但在情況下,我們嘗試使用S3,我們得到的只是這個日誌:

01-07 03:16:47.555: D/NFCJNI(2694): Discovered P2P Target 
01-07 03:16:47.555: D/NfcService(2694): LLCP Activation message 
01-07 03:16:48.880: D/NFCJNI(2694): Discovered P2P Target 
01-07 03:16:48.885: D/NfcService(2694): LLCP Activation message 
01-07 03:16:51.860: D/NFCJNI(2694): Discovered P2P Target 
01-07 03:16:51.860: D/NfcService(2694): LLCP Activation message 
01-07 03:16:53.185: D/NFCJNI(2694): Discovered P2P Target 
01-07 03:16:53.185: D/NfcService(2694): LLCP Activation message 
01-07 03:16:58.870: D/NFCJNI(2694): Discovered P2P Target 
01-07 03:16:58.870: D/NfcService(2694): LLCP Activation message 

而且任何Android應用註冊任何NFC事件都不會被喚醒。看起來它們是S3和讀卡器之間的一些兼容性問題,或者是S3的一些NFC實現問題。

請您告訴我們爲什麼兩個手機的操作系統版本相同(即Android 4.3)時爲什麼會有這種通信差異。爲什麼S3不會超越「LLCP激活信息」?我們使用這兩款手機的

系統信息可以在這裏找到

回答

0

如果你只想使用ISO-DEP卡模擬,你可能要正確註冊您的ACR122U NFC設備以獲得無源ISO 14443-4 PICC仿真。

目前使用TgInitAsTarget命令如下:

D4 8C (TgInitAsTarget) 
    04 (Mode = PICC only) 
    0000 (ATQA/SENS_RES = invalid) 
    000000 (NFCID1t/UID = 0x80000000) 
    20 (SAK/SEL_RES = ISO 14443-4 supported) 
    01FE0FBBBAA6C9890000000000000000FFFF (FeliCaParams) 
    01FE0FBBBAA6C9890000 (NFCID3t) 
    06 47666D010110 (6 ATR_RES general bytes) 
    00 (0 historical bytes) 

然而,當你不想使用NFC-DEP模式/ FeliCa的模式,你一定要設置FeliCa的參數,可以在NFCID3t和ATR_RES的一般字節爲零。此外,你會想要設置一個更有用的UID值和一個有效的ATQA(一個在設置了一個位幀反斜率位的位置)。我不確定這是否有必要,但我建議你也設置被動模式標誌。

D4 8C (TgInitAsTarget) 
    05 (Mode = PICC only | passive mode only) 
    0400 (ATQA/SENS_RES) 
(NFCID1t/UID) 
    20 (SAK/SEL_RES = ISO 14443-4 supported) 
    000000000000000000000000000000000000 (FeliCaParams) 
    00000000000000000000 (NFCID3t) 
    00 (no ATR_RES general bytes) 
    00 (no historical bytes) 

此外,您可能需要在某些ACR122U設備上設置其他配置寄存器。有關更多信息,請參閱this answer