2017-03-15 104 views
0

編輯:請閱讀完整的交代NFCA收發命令文件NFC-A(ISO 14443-3A)

我在哪裏可以找到android.nfc.tech.NfcA使用的文件提交henrycjc和我兩個答案?

/** 
* Provides access to NFC-A (ISO 14443-3A) properties and I/O operations on a {@link Tag}. 
* 
* <p>Acquire a {@link NfcA} object using {@link #get}. 
* <p>The primary NFC-A I/O operation is {@link #transceive}. Applications must 
* implement their own protocol stack on top of {@link #transceive}. 
* 
* <p class="note"><strong>Note:</strong> Methods that perform I/O operations 
* require the {@link android.Manifest.permission#NFC} permission. 
*/ 
public byte[] transceive(byte[] data) throws IOException 

我不太清楚tranceive語法是如何工作的,我目前的理解是,在byte[]第一byte是命令,我想找到在哪裏可以找到這些列表。我試圖自己查看,但空手而來。

卡我試圖與互動: (轉儲圖片) Image of dump

(詳細轉儲)

<?xml version="1.0" encoding="UTF-8"?> 
    <scan> 
     <version>4.21.171</version> 
     <date>2017-03-15 20:12:20</date> 
     <title>NXP Semiconductors NTAG213 tag as Type 2 Tag</title> 
     <uid nxp="true">04:39:F5:B2:95:3C:81</uid> 
     <hasndef>true</hasndef> 
     <ndef>D00000</ndef> 
     <section> 
      <subsection title="IC manufacturer"> 
       <block type="text"> 
     <content>NXP Semiconductors</content> 
    </block> 
      </subsection> 
      <subsection title="IC type"> 
       <block type="text"> 
     <content>NTAG213</content> 
    </block> 
      </subsection> 
      <subsection title="NFC Forum NDEF-compliant tag"> 
       <block type="text"> 
     <content>Type 2 Tag</content> 
    </block> 
      </subsection> 
     </section> 
     <section> 
      <subsection title="NFC data set information"> 
       <block type="text"> 
     <content>NDEF message containing 1 record 
    Current message size: 3 bytes 
    Maximum message size: 137 bytes 
    NFC data set access: Read &amp; Write 
    Can be made Read-Only</content> 
    </block> 
      </subsection> 
      <subsection title="Record #1: Empty record"> 
       <block type="text"> 
     <content><size size="12">Type Name Format: Empty<hexoutput> (0)</hexoutput> 
    Short Record</size></content> 
    </block><block type="text"> 
     <content><mono>type: [NULL] 
    </mono></content> 
    </block> 
    <block type="text"> 
     <content>Payload length: 0 bytes</content> 
    </block> 
      </subsection> 
      <subsection title="NDEF message"> 
       <block type="File"> 
     <address>0</address> 
     <data>D0 00 00</data> 
    </block> 
      </subsection> 
      <subsection title="NDEF Capability Container (CC)"> 
       <block type="text"> 
     <content>Mapping version: 1.0 
    Maximum NDEF data size: 144 bytes<hexoutput> (0x12)</hexoutput> 
    NDEF access: Read &amp; Write<hexoutput> (0x00)</hexoutput></content> 
    </block><block type="File"> 
     <address>-1</address> 
     <data>E1 10 12 00</data> 
    </block> 
      </subsection> 
      <subsection title="Control TLVs"> 
       <block type="text"> 
     <content>Lock Control TLV at address 0x04, offset 0 
    ‣ Dynamic lock bytes at address 0x28, offset 0 
     • 12 lock bits<hexoutput> (0x0C)</hexoutput> 
     • 8 bytes locked per lock bit<hexoutput> (0x3) 
     • Address calculation: 
      ◦ page address: 0xA 
      ◦ byte offset: 0x0 
      ◦ 16 bytes per page (1&lt;&lt;0x4)</hexoutput></content> 
    </block> 
    <block type="File"> 
     <address>-1</address> 
     <data>01 03 A0 0C 34</data> 
    </block> 
      </subsection> 
     </section> 
     <section> 
      <subsection title="Memory size"> 
       <block type="text"> 
     <content>144 bytes user memory 
    ‣ 36 pages, with 4 bytes per page</content> 
    </block> 
      </subsection> 
      <subsection title="IC detailed information"> 
       <block type="text"> 
     <content>Full product name: NT2H1311G0DUx 
    Capacitance: 50 pF</content> 
    </block> 
      </subsection> 
      <subsection title="Version information"> 
       <block type="text"> 
     <content>Vendor ID: NXP<hexoutput> (0x04)</hexoutput> 
    Type: NTAG<hexoutput> (0x04)</hexoutput> 
    Subtype: 50 pF<hexoutput> (0x02)</hexoutput> 
    Major version: 1<hexoutput> (0x01)</hexoutput> 
    Minor version: V0<hexoutput> (0x00)</hexoutput> 
    Storage size: 144 bytes<hexoutput> (0x0F)</hexoutput> 
    Protocol: ISO/IEC 14443-3<hexoutput> (0x03)</hexoutput></content> 
    </block> 
      </subsection> 
      <subsection title="Configuration information"> 
       <block type="text"> 
     <content>ASCII mirror disabled 
    NFC counter: disabled 
    No limit on wrong password attempts 
    Strong load modulation enabled</content> 
    </block> 
      </subsection> 
      <subsection title="Originality check"> 
       <block type="text"> 
     <content>Signature verified with NXP public key<hexoutput> 
    Public key: 
    ‣ 0x04494E1A386D3D3CFE3DC10E5DE68A499B1C202DB5B132393E89ED19FE5BE8BC61 
    </hexoutput><hexoutput>ECDSA signature: 
    ‣ r: 0xDBD6E5FD688FA25BDF05B508911743E2 
    ‣ s: 0x8271C6D1D7110F0350E191ED2C3FAE85</hexoutput></content> 
    </block> 
      </subsection> 
     </section> 
     <section> 
      <subsection title="Technologies supported"> 
       <block type="text"> 
     <content>ISO/IEC 14443-3 (Type A) compatible 
    ISO/IEC 14443-2 (Type A) compatible</content> 
    </block> 
      </subsection> 
      <subsection title="Android technology information"> 
       <block type="text"> 
     <content>Tag description: 
    ‣ TAG: Tech [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.Ndef] 
    android.nfc.tech.Ndef 
    android.nfc.tech.MifareUltralight 
    android.nfc.tech.NfcA 
    ‣ Maximum transceive length: 253 bytes 
    ‣ Default maximum transceive time-out: 618 ms 
    <hexoutput>No MIFARE Classic support present in Android</hexoutput></content> 
    </block> 
      </subsection> 
      <subsection title="Detailed protocol information"> 
       <block type="text"> 
     <content>ID: 04:39:F5:B2:95:3C:81 
    ATQA: 0x4400 
    SAK: 0x00</content> 
    </block> 
      </subsection> 
      <subsection title="Memory content"> 
       <block type="Ultralight"> 
     <address>0</address> 
     <data access="* " comment="(UID0-UID2, BCC0)">04 39 F5 40</data> 
    </block> 
    <block type="Ultralight"> 
     <address>1</address> 
     <data access="* " comment="(UID3-UID6)">B2 95 3C 81</data> 
    </block> 
    <block type="Ultralight"> 
     <address>2</address> 
     <data access=". " comment="(BCC1, INT, LOCK0-LOCK1)">9A 48 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>3</address> 
     <data access=". " comment="(OTP0-OTP3)">E1 10 12 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>4</address> 
     <data access=". ">01 03 A0 0C</data> 
    </block> 
    <block type="Ultralight"> 
     <address>5</address> 
     <data access=". ">34 03 03 D0</data> 
    </block> 
    <block type="Ultralight"> 
     <address>6</address> 
     <data access=". ">00 00 FE 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>7</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>8</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>9</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>10</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>11</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>12</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>13</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>14</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>15</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>16</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>17</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>18</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>19</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>20</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>21</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>22</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>23</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>24</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>25</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>26</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>27</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>28</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>29</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>30</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>31</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>32</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>33</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>34</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>35</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>36</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>37</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>38</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>39</address> 
     <data access=". ">00 00 00 00</data> 
    </block> 
    <block type="Ultralight"> 
     <address>40</address> 
     <data access=". " comment="(LOCK2-LOCK4, CHK)">00 00 00 BD</data> 
    </block> 
    <block type="Ultralight"> 
     <address>41</address> 
     <data access=". " comment="(CFG, MIRROR, AUTH0)">04 00 00 FF</data> 
    </block> 
    <block type="Ultralight"> 
     <address>42</address> 
     <data access=". " comment="(ACCESS)" length="2">00 05</data> 
    </block> 
    <block type="Ultralight"> 
     <address>43</address> 
     <data access="+P" comment="(PWD0-PWD3)">FF FF FF FF</data> 
    </block> 
    <block type="Ultralight"> 
     <address>44</address> 
     <data access="+P" comment="(PACK0-PACK1)" length="2">00 00</data> 
    </block> 
    <block type="text"> 
     <content> 
     *:locked &amp; blocked, x:locked, 
     +:blocked, .:un(b)locked, ?:unknown 
     r:readable (write-protected), 
     p:password protected, -:write-only 
     P:password protected write-only</content> 
    </block> 
      </subsection> 
     </section> 
    </scan> 

在此先感謝。

編輯:請閱讀完整的交代

回答

0

的文檔可以在Android官方文檔中找到提交henrycjc和我兩個答案。具體來說,收發是在這裏:

https://developer.android.com/reference/android/nfc/tech/NfcA.html#transceive(byte[])

至於你的其他問題,我想看看這些以前的SO問題:

Android nfcA.connect(), nfcA.transceive(), nfcA.setTimeout() and nfcA.getMaxTransceiveLength()

How send NfcA command to the MIFARE card?

+1

謝謝您的回答! http://stackoverflow.com/questions/40288795/android-nfca-connect-nfca-transceive-nfca-settimeout-and-nfca-getmaxtran包含我正在尋找的答案! –

2

對於有人誰是專門找NFC命令(因爲那些很難找到)

我做了一些(由henrycjc用指針在正確的方向),挖你

enter image description here 來源:http://www.nxp.com/documents/data_sheet/NTAG213_215_216.pdf

+0

不錯。出於興趣,你是否因爲Android 7.0。*格式化NDEF的錯誤? – henrycjc

+0

我正在寫一個應用程序,可以寫一個鏈接到一個標籤,但我不希望我的用戶不得不購買特定的標籤,因爲我不得不使用'android.nfc.tech.NfcA'。我設法使用以下方式將數據寫入特定位置:D。 –

+0

另外,是的。我也遇到了這個錯誤,但認爲我做錯了。 [看起來像更多的用戶遇到這個問題](https://code.google.com/p/android/issues/detail?id=227165)... –