Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy I can't read ST M24LR64 as NDEF messages with Android NFC
    primarykey
    data
    text
    <p>M24LR64 IC from STMicroelectronics supports ISO 15693 protocol, also called NfcV in Android NFC. When I placed my Nexus S phone (Android 4.0.4) near to my prototype tag board, I could hear a beep, and saw a message fired by the logcat: </p> <pre><code>no tag fallback activity found for Intent { act = android.nfc.action.TAG_DISCOVERED} </code></pre> <p>I wondered why the android dispatched the ACTION_TAG_DISCOVERED intent, not the ACTION_NDEF_DISCOVERED, because I had constructured the ndef format messages following the ST application note. And I can read the NDEF message with the ST own reader software called NfcV-Reader.</p> <p>Then I composed a demo program in android to verify the problem. When I registered intent with this AndroidManifest.xml</p> <pre><code>&lt;intent-filter&gt; &lt;action android:name="android.nfc.action.NDEF_DISCOVERED" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; </code></pre> <p>I can't receive the NFC message. When I modified with this </p> <p>I can receive the NFC message from Android system. But when I checked the NDEF message with the expression</p> <pre><code>Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); </code></pre> <p>the <code>rawMsgs</code> variable is <code>null</code>! So I reviewed the ST NfcV-Reader source code, and found that it had processed all the data from M24LR64 EEPROM with read block. That means raw data read, do not use off-the-shelf utility from Android NFC and NDEF.</p> <pre><code>protected Void doInBackground(Void... params) { DataDevice dataDevice = (DataDevice)getApplication(); fullNdefMessage = null; byte[] resultBlock0 = new byte[4]; byte[] resultBlock1 = new byte[8]; cpt = 0; resultBlock0 = null; while ((resultBlock0 == null || resultBlock0[0] == 1)&amp;&amp; cpt&lt;1500) { resultBlock0 = NFCCommand.SendReadSingleBlockCommand(dataDevice.getCurrentTag(), new byte[]{0x00,0x00}, dataDevice); cpt ++; Log.v("CPT ", " CPT Read Block 0 ===&gt; " + String.valueOf(cpt)); } //if CC0 = E1h &amp; CC1 = right version if(resultBlock0[0]==(byte)0x00 &amp;&amp; resultBlock0[1]==(byte)0xE1 &amp;&amp; resultBlock0[2]==(byte)0x40) { //NDEF TAG Format valid cpt = 0; resultBlock1 = null; while ((resultBlock1 == null || resultBlock1[0] == 1) &amp;&amp; cpt &lt; 10) { resultBlock1 = NFCCommand.SendReadMultipleBlockCommand(dataDevice.getCurrentTag(),new byte[]{0x00,0x01}, (byte)0x02, dataDevice); } if(resultBlock1[1]==(byte)0x03 &amp;&amp; resultBlock1[6]==(byte)0x54) // Text message { if(resultBlock1[5]&lt;0) numberOfBlockToRead = ((resultBlock1[5] + 256 + 14)/4); else numberOfBlockToRead = ((resultBlock1[5] + 14)/4); } else if(resultBlock1[1]==(byte)0x03 &amp;&amp; resultBlock1[6]==(byte)0x55) // URL message { if(resultBlock1[1]&lt;0) numberOfBlockToRead = ((resultBlock1[2] + 256 + 12)/4); else numberOfBlockToRead = ((resultBlock1[2] + 12)/4); } } else { //Not NDEF TAG Format numberOfBlockToRead = 0; } bNumberOfBlock = Helper.ConvertIntTo2bytesHexaFormat(numberOfBlockToRead); cpt = 0; if(numberOfBlockToRead &lt;32) { while ((fullNdefMessage == null || fullNdefMessage[0] == 1) &amp;&amp; cpt &lt; 10 &amp;&amp; numberOfBlockToRead != 0) { fullNdefMessage = NFCCommand.SendReadMultipleBlockCommandCustom(dataDevice.getCurrentTag(),new byte[]{0x00,0x00}, bNumberOfBlock[1], dataDevice); cpt++; } } else { while ((fullNdefMessage == null || fullNdefMessage[0] == 1) &amp;&amp; cpt &lt; 10 &amp;&amp; numberOfBlockToRead != 0) { fullNdefMessage = NFCCommand.SendReadMultipleBlockCommandCustom2(dataDevice.getCurrentTag(),new byte[]{0x00,0x00}, bNumberOfBlock, dataDevice); cpt++; Log.i("CPT ", "***** " + String.valueOf(cpt)); } } return null; } </code></pre> <p>My question is whether I can use the android NDEF facility but not raw block read and write to process my NFC tag with ISO 15693? How can I format my data in M24LR64 EEPROM?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload