C API for BALTECH SDK

§ brp_Iso14a_Select()

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. The PICC has to be in ready state (see Iso14a.Request command) for this command to succeed.

PICCs exist with three different lengths of serial numbers:

  • Four bytes (single size)
  • Seven bytes (double size)
  • Ten bytes (triple size)

In manual anti-collision mode, the Iso14a.Select command can only return 4 Bytes of the serial number at a time, in the Serial returned variable. Iso14a.Select therefore needs to be called one, two or three times to read serial numbers of single, double or triple size, respectively. Each call of the Iso14a.Select command is associated to a specific cascade level , specified by the CascLev parameter. The first call of Iso14a.Select is associated to cascade level 1, the second call to cascade level 2, and the third call to cascade level 3.

The fact that a serial number has not been completely returned by the Iso14a.Select command is indicated by a cascade tag (CT, 0x88), in the first byte of the returned Serial variable. In this case, the Iso14a.Select command needs to be called with the next higher cascade level (for instance CascLev = 2 if Iso14a.Select was called with CascLev = 1). The complete serial number of a PICC consists then of the concatenation of the (up to 3) returned values of Serial , after removing the cascade tags(s) from these values. A completed selection flow is signaled by the Casc flag in the SAK byte and by the missing cascade tag in the returned serial number.

Using the PreSelSer parameter, the serial number (or an initial part of it) of a given PICC can be specified to be selected within a specific cascade level (up to four bytes) in order to speed up the anti-collision sequence. The CT must be included in PreSelSer if it belongs to non-final parts of the serial number.

For convenience reasons, an automatic anti-collision mode has been implemented. This mode can be activated by setting the CascLev parameter to 0. In this case, the PICC can be selected with a single call of Iso14a.Select and the returned Serial variable contains the complete serial number, without cascade tag(s).

In this case, cascade tags must be manually added to the PreSelSer parameter to be able to use the preselection feature.

This command combines the commands ANTICOLL and SELECT as specified in the ISO 14443-3 (Type A) standard.

Parameters
[in]protocolused to execute the command
[in]CascLevSelects cascade level of anti-collision sequence: * 0: complete serial number * 1, 2 or 3: cascade level 1, 2 or 3
[in]BitCountNumber of valid bits in PreSelSer (0 - 96).
[in]PreSelSerPart of serial number (beginning at its head), which will be used for the preselection of a PICC.
[in]PreSelSer_len
[out]SAKSelect Acknowledge (SAK), according to the ISO 14443-3 (Type A) standard.
[out]SerialSerial number of selected label.
[out]Serial_len
[in]mempoolis used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool