Data Structures | Enumerations

nfc-types.h File Reference

Define NFC types. More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  nfc_device_t
 NFC device information. More...
struct  nfc_device_desc_t
 NFC device description. More...
struct  chip_callbacks
 Functions for chip specific functions. More...
struct  driver_callbacks
 Generic structure to handle NFC device functions. More...
struct  nfc_dep_info_t
 NFC tag information in Data Exchange Protocol. More...
struct  nfc_iso14443a_info_t
 NFC ISO14443A tag (MIFARE) information. More...
struct  nfc_felica_info_t
 NFC FeLiCa tag information. More...
struct  nfc_iso14443b_info_t
 NFC ISO14443B tag information. More...
struct  nfc_jewel_info_t
 NFC Jewel tag information. More...
union  nfc_target_info_t
 Union between all kind of tags information structures. More...
struct  nfc_target_t
 NFC target structure. More...

Enumerations

enum  nfc_device_option_t {
  NDO_HANDLE_CRC = 0x00, NDO_HANDLE_PARITY = 0x01, NDO_ACTIVATE_FIELD = 0x10, NDO_ACTIVATE_CRYPTO1 = 0x11,
  NDO_INFINITE_SELECT = 0x20, NDO_ACCEPT_INVALID_FRAMES = 0x30, NDO_ACCEPT_MULTIPLE_FRAMES = 0x31, NDO_AUTO_ISO14443_4 = 0x40,
  NDO_EASY_FRAMING = 0x41
}
 

NFC device option.

More...
enum  nfc_modulation_t {
  NM_ISO14443A_106 = 0x00, NM_FELICA_212 = 0x01, NM_FELICA_424 = 0x02, NM_ISO14443B_106 = 0x03,
  NM_JEWEL_106 = 0x04, NM_ACTIVE_DEP = 0x05, NM_PASSIVE_DEP = 0x06
}
 

NFC modulation.

More...
enum  nfc_target_type_t {
  NTT_GENERIC_PASSIVE_106 = 0x00, NTT_GENERIC_PASSIVE_212 = 0x01, NTT_GENERIC_PASSIVE_424 = 0x02, NTT_ISO14443B_106 = 0x03,
  NTT_JEWEL_106 = 0x04, NTT_MIFARE = 0x10, NTT_FELICA_212 = 0x11, NTT_FELICA_424 = 0x12,
  NTT_ISO14443A_106 = 0x20, NTT_ISO14443B_TCL_106 = 0x23, NTT_DEP_PASSIVE_106 = 0x40, NTT_DEP_PASSIVE_212 = 0x41,
  NTT_DEP_PASSIVE_424 = 0x42, NTT_DEP_ACTIVE_106 = 0x80, NTT_DEP_ACTIVE_212 = 0x81, NTT_DEP_ACTIVE_424 = 0x82
}
 

NFC target type enumeration.

More...

Detailed Description

Define NFC types.

Public platform independent Near Field Communication (NFC) library

Copyright (C) 2009, Roel Verdult

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Definition in file nfc-types.h.


Enumeration Type Documentation

NFC device option.

Enumerator:
NDO_HANDLE_CRC 

Let the PN53X chip handle the CRC bytes. This means that the chip appends the CRC bytes to the frames that are transmitted. It will parse the last bytes from received frames as incoming CRC bytes. They will be verified against the used modulation and protocol. If an frame is expected with incorrect CRC bytes this option should be disabled. Example frames where this is useful are the ATQA and UID+BCC that are transmitted without CRC bytes during the anti-collision phase of the ISO14443-A protocol.

NDO_HANDLE_PARITY 

Parity bits in the network layer of ISO14443-A are by default generated and validated in the PN53X chip. This is a very convenient feature. On certain times though it is useful to get full control of the transmitted data. The proprietary MIFARE Classic protocol uses for example custom (encrypted) parity bits. For interoperability it is required to be completely compatible, including the arbitrary parity bits. When this option is disabled, the functions to communicating bits should be used.

NDO_ACTIVATE_FIELD 

This option can be used to enable or disable the electronic field of the NFC device.

NDO_ACTIVATE_CRYPTO1 

The internal CRYPTO1 co-processor can be used to transmit messages encrypted. This option is automatically activated after a successful MIFARE Classic authentication.

NDO_INFINITE_SELECT 

The default configuration defines that the PN53X chip will try indefinitely to invite a tag in the field to respond. This could be desired when it is certain a tag will enter the field. On the other hand, when this is uncertain, it will block the application. This option could best be compared to the (NON)BLOCKING option used by (socket)network programming.

NDO_ACCEPT_INVALID_FRAMES 

If this option is enabled, frames that carry less than 4 bits are allowed. According to the standards these frames should normally be handles as invalid frames.

NDO_ACCEPT_MULTIPLE_FRAMES 

If the NFC device should only listen to frames, it could be useful to let it gather multiple frames in a sequence. They will be stored in the internal FIFO of the PN53X chip. This could be retrieved by using the receive data functions. Note that if the chip runs out of bytes (FIFO = 64 bytes long), it will overwrite the first received frames, so quick retrieving of the received data is desirable.

NDO_AUTO_ISO14443_4 

This option can be used to enable or disable the auto-switching mode to ISO14443-4 is device is compliant

NDO_EASY_FRAMING 

Use automatic frames encapsulation and chaining.

Definition at line 146 of file nfc-types.h.

NFC modulation.

Enumerator:
NM_ISO14443A_106 

ISO14443-A (NXP MIFARE) http://en.wikipedia.org/wiki/MIFARE

NM_FELICA_212 

JIS X 6319-4 (Sony Felica) http://en.wikipedia.org/wiki/FeliCa

NM_FELICA_424 

JIS X 6319-4 (Sony Felica) http://en.wikipedia.org/wiki/FeliCa

NM_ISO14443B_106 

ISO14443-B http://en.wikipedia.org/wiki/ISO/IEC_14443

NM_JEWEL_106 

Jewel Topaz (Innovision Research & Development)

NM_ACTIVE_DEP 

Active DEP

NM_PASSIVE_DEP 

Passive DEP

Definition at line 174 of file nfc-types.h.

NFC target type enumeration.

Enumerator:
NTT_GENERIC_PASSIVE_106 

Generic passive 106 kbps (ISO/IEC14443-4A, mifare, DEP)

NTT_GENERIC_PASSIVE_212 

Generic passive 212 kbps (FeliCa, DEP)

NTT_GENERIC_PASSIVE_424 

Generic passive 424 kbps (FeliCa, DEP)

NTT_ISO14443B_106 

Passive 106 kbps ISO/IEC14443-4B

NTT_JEWEL_106 

Innovision Jewel tag

NTT_MIFARE 

mifare card

NTT_FELICA_212 

FeliCa 212 kbps card

NTT_FELICA_424 

FeliCa 424 kbps card

NTT_ISO14443A_106 

Passive 106 kbps ISO/IEC14443-4A

NTT_ISO14443B_TCL_106 

Passive 106 kbps ISO/IEC14443-4B with TCL flag

NTT_DEP_PASSIVE_106 

DEP passive 106 kbps

NTT_DEP_PASSIVE_212 

DEP passive 212 kbps

NTT_DEP_PASSIVE_424 

DEP passive 424 kbps

NTT_DEP_ACTIVE_106 

DEP active 106 kbps

NTT_DEP_ACTIVE_212 

DEP active 212 kbps

NTT_DEP_ACTIVE_424 

DEP active 424 kbps

Definition at line 268 of file nfc-types.h.