知識社群Login
Write Mifare Card
by 艾鍗學院, 2012-05-21 00:15, Views(1661)

Write Mifare Card


At start, to put NDEF content that can be readed by other readers, the tag have to be NFC Forum compiliant. To bring Mifare Classic as NFC Forum enabled tag, you have to follow the dedicated application note:  "Mifare Classic as NFC Forum Enable Tag" from NXP.

This application note explain how to use MAD and Mifare Classic sectors in order to put NDEF content in sectors, so you need to know about MAD, by reading (and implementing) "MIFARE Application Directory (MAD)" from NXP.

These files are also useful:
Mifare Std as NFC Forum Enabled Tag - Extensions for Mifare standard 1k/4k as NFC Forum Enable Tag (v.1.1, 2010-10-01)
NXP Type MF1K/4K Tag Operation - Storing NFC Forum data in Mifare Standard 1k/4k (v.1.1, 2010-10-01)

Once you have a tag that can handle NDEF content, you need to learn how to forge NDEF message, that contains NDEF records. To do this, you need to read NFCForum-TS-NDEF_1.0 from NFCForum and you need to understand types described in :

  • NFCForum-SmartPoster_RTD_1.0,

  • NFCForum-TS-GenericControlRTD_1.0,

  • NFCForum-TS-RTD_1.0 and

  • NFCForum-TS-RTD_Text_1.0

Finally, I should point to you two projects that you can be interested in :
- libfreefare, that allow mifare manipulation and provide an example to write ndef on Mifare Classic and Mifare DESFire tag.
- libndef that enable you to simply manipulate NDEF messages and records in Object Oriented way.


使用 aplay to play wave file 


aplay -t raw -c 1 -f S16_LE -r 8000 test2.pcm  -t: type raw

表示是PCM  -c: channel 1  -f S16_LE: Signed 16bit-width Little-Endian  -r: sample rate 8000  PCM是最raw的音頻數據,沒有任何頭信息。WAV文件就是PCM+頭信息,頭信息就是上述的聲道數,sample rate這些。所以WAV文件可以直接播放,而PCM需要手動指定這些信息之後才能播放