C API for BALTECH SDK
iso14b.h File Reference

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

#include "../typedefs.h"

Go to the source code of this file.

Macros

#define BRP_Iso14b_ErrNoTag   BRP_ERR_STATUS(0x1400, 0x01)
 No card in field of antenna or card in field of antenna does not match given VHL-file. More...
 
#define BRP_Iso14b_ErrCollision   BRP_ERR_STATUS(0x1400, 0x02)
 More than one PICC answered in the same time slot and none of them could therefore be requested correctly. More...
 
#define BRP_Iso14b_ErrAuth   BRP_ERR_STATUS(0x1400, 0x03)
 Authentication error. More...
 
#define BRP_Iso14b_ErrHf   BRP_ERR_STATUS(0x1400, 0x04)
 General HF error. More...
 
#define BRP_Iso14b_ErrFrame   BRP_ERR_STATUS(0x1400, 0x07)
 Bit error, parity error or frame error (start/stop bit). More...
 
#define BRP_Iso14b_ErrCrc   BRP_ERR_STATUS(0x1400, 0x08)
 CRC checksum error. More...
 
#define BRP_Iso14b_ErrCom   BRP_ERR_STATUS(0x1400, 0x10)
 Error in communication with reader chip. More...
 
#define BRP_Iso14b_ErrEeprom   BRP_ERR_STATUS(0x1400, 0x21)
 Error accessing EEPROM of the reader chip. More...
 
#define BRP_Iso14b_ErrCardNotSupported   BRP_ERR_STATUS(0x1400, 0x22)
 Reader chip does not support card type. More...
 
#define BRP_Iso14b_ErrMem   BRP_ERR_STATUS(0x1400, 0x23)
 Either internal list of labels or response buffer full. More...
 
#define BRP_Iso14b_ErrHwNotSupported   BRP_ERR_STATUS(0x1400, 0x24)
 Command not supported by hardware. More...
 

Functions

brp_errcode brp_Iso14b_Request (brp_protocol protocol, bool ReqAll, brp_Iso14b_Request_TimeSlots TimeSlots, unsigned AFI, brp_Iso14b_Request_ValueList_Entry **ValueList, size_t *ValueList_len, brp_mempool *mempool)
 Scan for ISO 14443 (Type B) compliant PICCs in the field of the antenna. More...
 
brp_errcode brp_Iso14b_Attrib (brp_protocol protocol, brp_buf PUPI, brp_Iso14b_Attrib_TR0 TR0, brp_Iso14b_Attrib_TR1 TR1, brp_Iso14b_Attrib_EOF_ EOF_, brp_Iso14b_Attrib_SOF SOF, brp_DivisorInteger DSI, brp_DivisorInteger DRI, brp_Iso14b_Attrib_FSDI FSDI, unsigned CID, bool EnHLR, bool EnMBLI, bool EnCID, unsigned *AssignedCID, unsigned *MBLI, brp_buf *HLR, size_t *HLR_len, brp_mempool *mempool)
 Select the PICC with given PUPI serial number for further communication. More...
 
brp_errcode brp_Iso14b_Halt (brp_protocol protocol, brp_buf PUPI)
 Switch the PICC with the given PUPI serial number into halt state, so that it will not answer to further brp_Iso14b_Request() commands, except when the ReqAll flag parameter of the brp_Iso14b_Request() command is set. More...
 
brp_errcode brp_Iso14b_SetTransparentSettings (brp_protocol protocol, brp_Iso14b_SetTransparentSettings_Tags_Entry *Tags, size_t Tags_len)
 **This command is obsolete and included here only for compatibility reasons. More...
 
brp_errcode brp_Iso14b_GetTransparentSettings (brp_protocol protocol, brp_Iso14b_GetTransparentSettings_Tags_Entry **Tags, size_t *Tags_len, brp_mempool *mempool)
 **This command is obsolete and included here only for compatibility reasons. More...
 
brp_errcode brp_Iso14b_TransparentCmd (brp_protocol protocol, unsigned EnCRCRX, unsigned EnCRCTX, unsigned SendDataLen, unsigned Timeout, brp_DivisorInteger DSI, brp_DivisorInteger DRI, brp_buf SendData, size_t SendData_len, brp_buf *RecvData, size_t *RecvData_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...
 

Detailed Description

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

A PICC compliant to ISO 14443-3 (Type B) 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 of an antenna, it is in power off state. When the PICC gets into the HF field, it will switch to idle state automatically. The brp_Iso14b_Request() command scans for PICCs in idle state and returns necessary information about them to the host. Furthermore, this command will change the state of the detected PICCs to ready state. The brp_Iso14b_Halt() command can be used to set PICCs from ready state to halt state so that they do not respond to conventional brp_Iso14b_Request() commands any longer. PICCs in halt state can only be reactivated by setting a special parameter flag in the brp_Iso14b_Request() command.

From ready state, one or more PICCs may be switched to the active state via the brp_Iso14b_Attrib() command. Not all PICCs support being in active state while other PICCs are at the same time: such PICCs need to be selected exclusively instead.

Communication with the PICC by means of APDU exchanges is subject to the ISO 14443-4 standard which is explained in detail in the iso14l4.h. Only PICCs in active state are able to execute ISO 14443-4 commands. For proprietary PICCs which are not compliant to the ISO 14443-4 standard, brp_Iso14b_TransparentCmd() should be used instead. It provides a raw communication channel between the application and the PICC, without any interpretation of the transferred data within the reader, thereby allowing to send/receive arbitrary request/response data to/from the PICC.

After data exchange is completed, the PICC may automatically be switched to halt state so that it does not respond to any command which may follow. Depending on the PICC being compliant to the ISO 14443-4 standard or not, either a special command of the iso14l4.h or a proprietary card command transmitted via brp_Iso14b_TransparentCmd() have to be used for this purpose. PICCs in halt state can only be reactivated by setting as special parameter flag in the brp_Iso14b_Request() command.

Definition in file iso14b.h.