libnfc  1.7.1
Data Structures | Typedefs | 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_dep_info
 NFC target information in D.E.P. (Data Exchange Protocol) see ISO/IEC 18092 (NFCIP-1) More...
struct  nfc_iso14443a_info
 NFC ISO14443A tag (MIFARE) information. More...
struct  nfc_felica_info
 NFC FeLiCa tag information. More...
struct  nfc_iso14443b_info
 NFC ISO14443B tag information. More...
struct  nfc_iso14443bi_info
 NFC ISO14443B' tag information. More...
struct  nfc_iso14443b2sr_info
 NFC ISO14443-2B ST SRx tag information. More...
struct  nfc_iso14443b2ct_info
 NFC ISO14443-2B ASK CTx tag information. More...
struct  nfc_jewel_info
 NFC Jewel tag information. More...
union  nfc_target_info
 Union between all kind of tags information structures. More...
struct  nfc_modulation
 NFC modulation structure. More...
struct  nfc_target
 NFC target structure. More...

Typedefs

typedef struct nfc_context nfc_context
typedef struct nfc_device nfc_device
typedef struct nfc_driver nfc_driver
typedef char nfc_connstring [NFC_BUFSIZE_CONNSTRING]

Enumerations

enum  nfc_property {
  NP_TIMEOUT_COMMAND, NP_TIMEOUT_ATR, NP_TIMEOUT_COM, NP_HANDLE_CRC,
  NP_HANDLE_PARITY, NP_ACTIVATE_FIELD, NP_ACTIVATE_CRYPTO1, NP_INFINITE_SELECT,
  NP_ACCEPT_INVALID_FRAMES, NP_ACCEPT_MULTIPLE_FRAMES, NP_AUTO_ISO14443_4, NP_EASY_FRAMING,
  NP_FORCE_ISO14443_A, NP_FORCE_ISO14443_B, NP_FORCE_SPEED_106
}
enum  nfc_dep_mode
 NFC D.E.P. (Data Exchange Protocol) active/passive mode.
enum  nfc_baud_rate
 NFC baud rate enumeration.
enum  nfc_modulation_type
 NFC modulation type enumeration.
enum  nfc_mode
 NFC mode type enumeration.

Detailed Description

Define NFC types.

Definition in file nfc-types.h.


Typedef Documentation

typedef char nfc_connstring[NFC_BUFSIZE_CONNSTRING]

Connection string

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

typedef struct nfc_context nfc_context

NFC context

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

typedef struct nfc_device nfc_device

NFC device

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

typedef struct nfc_driver nfc_driver

NFC device driver

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


Enumeration Type Documentation

Properties

Enumerator:
NP_TIMEOUT_COMMAND 

Default command processing timeout Property value's (duration) unit is ms and 0 means no timeout (infinite). Default value is set by driver layer

NP_TIMEOUT_ATR 

Timeout between ATR_REQ and ATR_RES When the device is in initiator mode, a target is considered as mute if no valid ATR_RES is received within this timeout value. Default value for this property is 103 ms on PN53x based devices.

NP_TIMEOUT_COM 

Timeout value to give up reception from the target in case of no answer. Default value for this property is 52 ms).

NP_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.

NP_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.

NP_ACTIVATE_FIELD 

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

NP_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.

NP_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.

NP_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.

NP_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.

NP_AUTO_ISO14443_4 

This option can be used to enable or disable the auto-switching mode to ISO14443-4 is device is compliant. In initiator mode, it means that NFC chip will send RATS automatically when select and it will automatically poll for ISO14443-4 card when ISO14443A is requested. In target mode, with a NFC chip compliant (ie. PN532), the chip will emulate a 14443-4 PICC using hardware capability

NP_EASY_FRAMING 

Use automatic frames encapsulation and chaining.

NP_FORCE_ISO14443_A 

Force the chip to switch in ISO14443-A

NP_FORCE_ISO14443_B 

Force the chip to switch in ISO14443-B

NP_FORCE_SPEED_106 

Force the chip to run at 106 kbps

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