C API for BALTECH SDK
iso14a.h File Reference

This command group implements the low-level ISO 14443-3 (Type A) commands according to the ISO 14443-3 (Type A) standard. More...

#include "../typedefs.h"

Go to the source code of this file.

Macros

#define BRP_Iso14a_ErrNoTag   BRP_ERR_STATUS(0x1300, 0x01)
 No card in field of antenna or card in field of antenna does not match the given VHL-file. More...
 
#define BRP_Iso14a_ErrCollision   BRP_ERR_STATUS(0x1300, 0x02)
 More than one PICC answered in the same time slot and none of them could therefore be requested correctly. More...
 
#define BRP_Iso14a_ErrHf   BRP_ERR_STATUS(0x1300, 0x04)
 General HF error. More...
 
#define BRP_Iso14a_ErrKey   BRP_ERR_STATUS(0x1300, 0x06)
 Key error (Only triggered by Mifare authentication). More...
 
#define BRP_Iso14a_ErrFrame   BRP_ERR_STATUS(0x1300, 0x07)
 Bit error, Parity error or Frame error (start/stop bit). More...
 
#define BRP_Iso14a_ErrCrc   BRP_ERR_STATUS(0x1300, 0x08)
 CRC checksum error. More...
 
#define BRP_Iso14a_ErrCom   BRP_ERR_STATUS(0x1300, 0x10)
 Error in communication with reader chip. More...
 
#define BRP_Iso14a_ErrEeprom   BRP_ERR_STATUS(0x1300, 0x21)
 Error accessing EEPROM of the reader chip. More...
 
#define BRP_Iso14a_ErrCardNotSupported   BRP_ERR_STATUS(0x1300, 0x22)
 Reader chip does not support card type. More...
 
#define BRP_Iso14a_ErrHwNotSupported   BRP_ERR_STATUS(0x1300, 0x23)
 Command not supported by hardware. More...
 
#define BRP_Iso14a_BreakErr   BRP_ERR_STATUS(0x1300, 0x30)
 Command has been interrupted. More...
 

Functions

brp_errcode brp_Iso14a_RequestLegacy (brp_protocol protocol, bool ReqAll, brp_Iso14a_RequestLegacy_UIDSize *UIDSize, unsigned *Coll, unsigned *ProprietaryCoding)
 This commands scans for ISO 14443-3 (Type A) compliant PICCs in the field of the antenna. More...
 
brp_errcode brp_Iso14a_Select (brp_protocol protocol, unsigned CascLev, unsigned BitCount, brp_buf PreSelSer, size_t PreSelSer_len, unsigned *SAK, brp_buf *Serial, size_t *Serial_len, brp_mempool *mempool)
 This command Performs the anti-collision and selection sequence of a PICC in the field of the antenna. More...
 
brp_errcode brp_Iso14a_Halt (brp_protocol protocol)
 Switch PICC to halt state. More...
 
brp_errcode brp_Iso14a_RequestATS (brp_protocol protocol, brp_Iso14a_RequestATS_FSDI FSDI, unsigned CID, brp_buf *ATS, size_t *ATS_len, brp_mempool *mempool)
 This command requests the Answer to Select (ATS) of the PICC according to the ISO 14443-3 (Type A) standard. More...
 
brp_errcode brp_Iso14a_PerformPPS (brp_protocol protocol, unsigned CID, brp_DivisorInteger DSI, brp_DivisorInteger DRI)
 This command sets up the communication parameters for ISO 14443-4 commands. More...
 
brp_errcode brp_Iso14a_Request (brp_protocol protocol, bool ReqAll, brp_buf *ATQA, bool *Collision, brp_mempool *mempool)
 This commands scans for ISO 14443-3 (Type A) compliant PICCs in the field of the antenna. More...
 
brp_errcode brp_Iso14a_Anticoll (brp_protocol protocol, unsigned BitCount, brp_buf PreSelectedSnr, brp_buf *SelectedSnr, brp_mempool *mempool)
 This command performs an anti-collision sequence. More...
 
brp_errcode brp_Iso14a_SelectOnly (brp_protocol protocol, brp_buf Snr, unsigned *SAK)
 This command selects a PICC with a 4 Byte serial number. More...
 
brp_errcode brp_Iso14a_TransparentCmd (brp_protocol protocol, bool EnMifBwProt, bool EnBitmode, bool EnCRCRX, bool EnCRCTX, bool ParityMode, bool EnParity, unsigned SendDataLen, unsigned Timeout, brp_DivisorInteger DSI, brp_DivisorInteger DRI, brp_buf SendData, size_t SendData_len, brp_buf *RcvData, size_t *RcvData_len, brp_mempool *mempool)
 This command sends a data stream to a card and returns the communication status and the received card data stream to the host. More...
 
brp_errcode brp_Iso14a_TransparentCmdBitlen (brp_protocol protocol, bool EnHighBaudOld, bool EnParTx, unsigned SendDataLen, unsigned Timeout, brp_DivisorInteger DSI, brp_DivisorInteger DRI, brp_buf SendData, size_t SendData_len, unsigned *RecvDataLen, unsigned *CollisionPosition, brp_buf *RecvData, size_t *RecvData_len, brp_mempool *mempool)
 This command is similar to Iso14a.TransparentCmd. More...
 

Detailed Description

This command group implements the low-level ISO 14443-3 (Type A) commands according to the ISO 14443-3 (Type A) standard.

A PICC compliant to ISO 14443-3 (Type A) is always in one of five states:

  1. Power off state
  2. Idle state
  3. Ready state
  4. Active state
  5. Halt state

As long as the PICC is not present in the HF field, it is in power off state. When the PICC gets into the field of the antenna, it automatically switches to the idle state. Once the brp_Iso14a_Request() command is invoked, PICCs in idle state will switch to the ready state. From there, a certain PICC, only one at the same time, may be switched to the active state via the brp_Iso14a_Select() command. This mechanism is identical for all ISO 14443 Type A PICCs.

PICC communication by means of APDU exchanges is subject to the ISO 14443-4 standard which is explained in detail in the iso14l4.h. Only PICCs which are compliant to ISO 14443-4 are able to execute commands transmitted according to ISO 14443-4, providing these PICCs are in the active state. However, before the first APDU exchange can be performed, the command brp_Iso14a_RequestATS() has to be executed in order to enable the ISO 14443-4 mode in the PICC. The command brp_Iso14a_PerformPPS() can be optionally invoked after brp_Iso14a_RequestATS() in order to increase communication speed.

For proprietary PICCs that are not compliant to the ISO 14443-4 standard, the command brp_Iso14a_TransparentCmd() should be used for communication. It provides a raw communication channel between application and PICC, without any interpretation of the transferred data within the reader, and therewith allows to send/receive arbitrary command/response data to/from the PICC.

After data exchange is completed, the PICC may be switched to the halt state so that it will not respond to any command which may follow. Depending on the PICC being in 14443-4 mode or not, either a special command of the iso14l4.h or the brp_Iso14a_Halt() command have to be used for this purpose. PICCs in halt state can only be reactivated by setting as special flag in the brp_Iso14a_Request() command.

Definition in file iso14a.h.