NFC/en: различия между версиями

Материал из Wiren Board
(Новая страница: «====C/C++==== Examples of working with libnfc in utilities provided with libnfc: http://code.google.com/p/libnfc/source/browse/#git%2Fexamples»)
(Новая страница: «== Software == The chip is supported by the library [http://nfc-tools.org/index.php?title=Libnfc libnfc], starting with release 1.7.0. Backport to Debian Wheezy:…»)
(не показано 5 промежуточных версий этого же участника)
Строка 9: Строка 9:
Backport to Debian Wheezy: [https://github.com/contactless/wirenboard/tree/master/contrib/libnfc], by default in a standard way.
Backport to Debian Wheezy: [https://github.com/contactless/wirenboard/tree/master/contrib/libnfc], by default in a standard way.


Work is done in userspace using spidev. By default when using the default dts file using device /dev/spidev1.4.
Работа производится через spidev в userspace. По-умолчанию при использовании стандартного dts файла используется устройство /dev/spidev1.4.
Default config: [https://github.com/contactless/wirenboard/blob/master/rootfs/configs/etc/nfc/libnfc.conf].
Конфиг по-умолчанию: [https://github.com/contactless/wirenboard/blob/master/rootfs/configs/etc/nfc/libnfc.conf].






=== Examples ===
===Примеры===


====The list of cards in the scope area====
====Список карточек в области видимости====
<pre>
<pre>
root@wirenboard:~# nfc-list  
root@wirenboard:~# nfc-list  
Строка 29: Строка 29:
</pre>
</pre>


====Reading Mifare Ultralight====
====Чтение Mifare Ultralight====
One-time tickets of the Moscow metro -Mifare UL cards.
Одноразовые билеты московского метро - карточки Mifare UL.
<pre>
<pre>
root@wirenboard:~# nfc-mfultralight r dump.mfd
root@wirenboard:~# nfc-mfultralight r dump.mfd
Строка 41: Строка 41:


====Python====
====Python====
To work with NFC from Python, you need to use bindings for libnfc. See example https://github.com/contactless/wirenboard/tree/master/examples/nfc/python on github.
Для работы с NFC из Python необходимо использовать биндинги для libnfc. См. пример https://github.com/contactless/wirenboard/tree/master/examples/nfc/python на гитхабе.


====C/C++====
====C/C++====
Examples of working with libnfc in utilities provided with libnfc: http://code.google.com/p/libnfc/source/browse/#git%2Fexamples
Примеры работы с libnfc в утилитах, поставляемых с libnfc: http://code.google.com/p/libnfc/source/browse/#git%2Fexamples

Версия 14:04, 19 июля 2019

Другие языки:


Hardware

NXP chip is used PN532/en. The chip is connected via SPI. GPIO is used as chip select.

Software

The chip is supported by the library libnfc, starting with release 1.7.0. Backport to Debian Wheezy: [1], by default in a standard way.

Работа производится через spidev в userspace. По-умолчанию при использовании стандартного dts файла используется устройство /dev/spidev1.4. Конфиг по-умолчанию: [2].


Примеры

Список карточек в области видимости

root@wirenboard:~# nfc-list 
nfc-list uses libnfc 1.7.0
NFC device: pn532_spi:/dev/spidev1.4 opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  44  
       UID (NFCID1): 04  f7  04  1a  0d  28  86  
      SAK (SEL_RES): 00  

Чтение Mifare Ultralight

Одноразовые билеты московского метро - карточки Mifare UL.

root@wirenboard:~# nfc-mfultralight r dump.mfd
NFC device: pn532_spi:/dev/spidev1.4 opened
Found MIFARE Ultralight card with UID: 04f7041a0d2886
Reading 16 pages |................|
Done, 16 of 16 pages readed.
Writing data to file: dump.mfd ... Done.

Python

Для работы с NFC из Python необходимо использовать биндинги для libnfc. См. пример https://github.com/contactless/wirenboard/tree/master/examples/nfc/python на гитхабе.

C/C++

Примеры работы с libnfc в утилитах, поставляемых с libnfc: http://code.google.com/p/libnfc/source/browse/#git%2Fexamples