C API for BALTECH SDK

§ brp_VHL_Select()

brp_errcode brp_VHL_Select ( brp_protocol  protocol,
brp_CardFamilies  CardFamiliesFilter,
bool  Reselect,
bool  AcceptConfCard,
brp_CardType SelectedCardType 
)

This command selects a card or tag in the antenna field for further operations. You need to run it successfully before you can use the following VHL commands:

Handling multiple cards in the antenna field

Using the Reselect parameter, you can interact with a card that you've already processed before (learn more in the Parameters section below).

Certain cards returnrandom IDs . If 2 or more cards with random IDs AND the same card family are present in the antenna field at the same time,VHL.Select detects these cards more than once.

Potential error cases after selection

After running VHL.Select successfully, the above commands will usually be executed successfully, even if the card temporarily leaves the antenna field. Communication parameters such as bit rate and frame size are automatically chosen to optimize performance.

However, problems with certain cards (e.g. MIFARE proX/DESFire) may occur when they're in the border area of the antenna field and brought in very slowly. In these cases, VHL.Select may be executed successful, but the subsequent command may fail.

In this case, make sure your application guarantees a suitable card distance, either by user guidance or by repetition of theVHL.IsSelected command until its success. This is especially important in conjunction with theVHL.ExchangeAPDU command since it doesn't perform retries internally.

Parameters
[in]protocolused to execute the command
[in]CardFamiliesFilterSelects the physical HF protocols that the reader will scan for cards. VHLSelect scans for the specified card families in a round-robin algorithm, i.e. the more card families you specify, the more time is needed to run a complete scan loop. Not all card types support all VHL commands. For details, see our overview ofsupported commands .
[in]ReselectIf false , the reader will deselect the current card and select the next one in the field. Cards you've already selected before will be ignored. Once you've run through all the cards in the field, you'll get a VHL.ErrNoTag status code. Cards will be reselected again when they're removed from the antenna field and then enter it again. If true , the reader will "forget" which cards it has already selected since the last execution of VHL.Select and will start all over with the first card. This means that the same card is reselected over and over again, while other cards in the field are ignored. To avoid this and start reselection only when all cards in the field have been selected once, set Reselect to false until you get a VHL.ErrNoTag status. Then set Reselect to true .
[in]AcceptConfCardIf true, the reader will scan every detected card and check if it's a BALTECH ConfigCard before returning from VHL.Select. Once the reader has found a ConfigCard, it will do the following: * Return the error code VHL.ConfcardRead * Transfer the configuration stored on the ConfigCard to its own configuration * Reboot to activate the new configuration
[out]SelectedCardTypeThe type of the selected card. Since there are no reliable identification standards amongst card manufacturers, we use a heuristic that examines the UID, its length, and other information as documented here. Due to the lack of standards, we cannot guarantee the card type is always identified correctly.