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:
- VHL.GetSnr
- VHL.GetATR
- VHL.Read
- VHL.Write
- VHL.ExchangeAPDU
- VHL.GetCardType
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 the VHL.IsSelected command until its success. This is especially important in conjunction with the VHL.ExchangeAPDU command since it doesn't perform retries internally.
- Parameters
-
| [in] | params | Struct with the following fields:
- protocol used to execute the command
- CardFamiliesFilter (in) Selects 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 .
- Reselect (in) Controls whether the reader starts a new selection cycle or continues iterating through cards already in the field. If true , the reader resets its internal card tracking and selects the first available card in the field - even if that card was already selected before. Use this to start or restart a selection cycle. If false , the reader skips cards it has already selected in the current cycle and picks the next unprocessed card. Once all cards in the field have been selected, you'll get a VHL.ErrNoTag status code. Cards become selectable again only after they leave and re-enter the antenna field. To iterate through all cards in the field exactly once and then restart: 1. Call VHL.Select(Reselect=true) to select the first card. 2. Process the card. 3. Call VHL.Select(Reselect=false) to select the second card. 4. Process the card. 5. Repeat steps 3 and 4 to iterate through the remaining cards until the command returns VHL.ErrNoTag . 6. Continue with step 1 to start a new cycle. **
- **AcceptConfCard (in) This feature is deprecated and will be removed in future firmware releases. We recommend you set this flag to false . To support ConfigCards, please use Autoread . If 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 The reader will also reboot if it fails to read the ConfigCard. To check the reconfiguration status, run VHL.CheckReconfigErr after the reboot. Reading ConfigCards currently only works iflegacy firmware support is enabled for the configuration. ConfigCards without legacy firmware support can currently only be read via Autoread .
- SelectedCardType (out) The 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.
|