C API for BALTECH SDK
vhl.h File Reference

VHL stands for Very High Level card access. More...

#include "../typedefs.h"

Go to the source code of this file.

Macros

#define BRP_VHL_ErrNoTag   BRP_ERR_STATUS(0x0100, 0x01)
 This status code occurs in the following cases: More...
 
#define BRP_VHL_ErrCardNotSelected   BRP_ERR_STATUS(0x0100, 0x02)
 The command can't be run because no card is selected. More...
 
#define BRP_VHL_ErrHf   BRP_ERR_STATUS(0x0100, 0x03)
 Communication problems with the card occurred. More...
 
#define BRP_VHL_ErrConfig   BRP_ERR_STATUS(0x0100, 0x04)
 The VHL file structure in the reader configuration is invalid or the specified VHL file isn't available. More...
 
#define BRP_VHL_ErrAuth   BRP_ERR_STATUS(0x0100, 0x05)
 An authentication error occurred. More...
 
#define BRP_VHL_ErrRead   BRP_ERR_STATUS(0x0100, 0x06)
 The communication sequence was OK, but reading failed. More...
 
#define BRP_VHL_ErrWrite   BRP_ERR_STATUS(0x0100, 0x07)
 The communication sequence was OK, but writing failed. More...
 
#define BRP_VHL_ConfcardRead   BRP_ERR_STATUS(0x0100, 0x08)
 A BALTECH ConfigCard has been detected successfully and will be read after this command. More...
 
#define BRP_VHL_ErrInvalidCardType   BRP_ERR_STATUS(0x0100, 0x09)
 The desired card type doesn't match the card family of the currently selected card. More...
 
#define BRP_VHL_ErrNotSupported   BRP_ERR_STATUS(0x0100, 0x0A)
 The command is currently not supported. More...
 
#define BRP_VHL_ErrFormat   BRP_ERR_STATUS(0x0100, 0x0B)
 The communication sequence was OK, but formatting failed. More...
 
#define BRP_VHL_ErrHw   BRP_ERR_STATUS(0x0100, 0x0C)
 An error occurred while communicating with the reader chip/SAM. More...
 
#define BRP_VHL_ErrApdu   BRP_ERR_STATUS(0x0100, 0x0D)
 Card communication error: The command has been aborted, or the response hasn't been read completely. More...
 

Functions

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. More...
 
brp_errcode brp_VHL_GetSnr (brp_protocol protocol, brp_buf *Snr, size_t *Snr_len, brp_mempool *mempool)
 This command returns the serial number (UID) of the currently selected card. More...
 
brp_errcode brp_VHL_Read (brp_protocol protocol, unsigned Id, unsigned Adr, unsigned Len, brp_buf *Data, size_t *Data_len, brp_mempool *mempool)
 This command reads data from a card based on a VHL file. More...
 
brp_errcode brp_VHL_Write (brp_protocol protocol, unsigned Id, unsigned Adr, brp_buf Data, size_t Data_len)
 This command writes data to a card based on a VHL file. More...
 
brp_errcode brp_VHL_IsSelected (brp_protocol protocol)
 This command checks if the card/label selected by the last execution of the brp_VHL_Select() command is still in the HF field of the antenna. More...
 
brp_errcode brp_VHL_GetLegacyATR (brp_protocol protocol, brp_buf *ATR, size_t *ATR_len, brp_mempool *mempool)
 This command is deprecated and should only be used for compatibility purposes with older firmware version. More...
 
brp_errcode brp_VHL_ExchangeAPDU (brp_protocol protocol, brp_CardType AssumedCardType, brp_buf Cmd, size_t Cmd_len, brp_buf *Resp, size_t *Resp_len, brp_mempool *mempool)
 This command sends APDUs to the currently selected card. More...
 
brp_errcode brp_VHL_Setup (brp_protocol protocol, brp_CardType ConsideredCardType, brp_buf MifareKey, bool AsKeyA, unsigned MadId, unsigned AppId, brp_DesfireFileDescription DesfireFileDesc, brp_buf Key, size_t Key_len, brp_buf SegmentInfo, size_t SegmentInfo_len, bool EnStamp, brp_VHL_Setup_AdrMode AdrMode, unsigned FirstBlock, unsigned BlockCount, brp_VHL_Setup_OptionFlag OptionFlag, unsigned BlockSize, unsigned SelectFileCmdListLen, brp_VHL_Setup_SelectFileCmdList_Entry *SelectFileCmdList, size_t SelectFileCmdList_len, unsigned FileLen, unsigned ApduTimeout)
 This command creates a VHL file dynamically and transfers it to the reader's RAM. More...
 
brp_errcode brp_VHL_SetupMifare (brp_protocol protocol, bool CustomKey, bool KeyA, brp_buf Key)
 This commands prepares the reader to access Mifare cards with the given Mifare key settings. More...
 
brp_errcode brp_VHL_SetupLegic (brp_protocol protocol, unsigned StampLen, unsigned SegmentID, brp_buf Stamp, size_t Stamp_len)
 This commands prepares the reader to access LEGIC cards with the given settings. More...
 
brp_errcode brp_VHL_SetupISO15 (brp_protocol protocol, unsigned FirstBlock, unsigned BlockCount, bool OptionFlag)
 This commands prepares the reader to access ISO15693 cards with the given settings. More...
 
brp_errcode brp_VHL_CheckReconfigErr (brp_protocol protocol, bool *Failed)
 This command returns the status of the last reconfiguration with a ConfigCard using the brp_VHL_Select() command. More...
 
brp_errcode brp_VHL_ExchangeLongAPDU (brp_protocol protocol, brp_CardType AssumedCardType, bool Reset, bool ContinueCmd, brp_buf Cmd, size_t Cmd_len, bool *ContinueResp, brp_buf *Resp, size_t *Resp_len, brp_mempool *mempool)
 This command sends basic Inter-Industry commands to the currently selected card in accordance with the ISO/IEC 7816-4 standard. More...
 
brp_errcode brp_VHL_GetFileInfo (brp_protocol protocol, unsigned Id, unsigned *Len, unsigned *BlockSize)
 This command returns the available size of the VHL-file whose ID is specified by the ID parameter. More...
 
brp_errcode brp_VHL_GetATR (brp_protocol protocol, brp_buf *ATR, size_t *ATR_len, brp_mempool *mempool)
 This command returns the Answer to Reset (ATR) of the currently selected card as defined in the PC/SC specification, version 2. More...
 
brp_errcode brp_VHL_Format (brp_protocol protocol, unsigned Id)
 This command formats a blank card based on a VHL file. More...
 
brp_errcode brp_VHL_ResolveFilename (brp_protocol protocol, char *FileName, unsigned *Id)
 This command returns the ID of a VHL file based on its filename. More...
 

Detailed Description

VHL stands for Very High Level card access.

With this command group, you can handle nearly all aspects of the card technology used in your project while avoiding complex low-level command sequences.

You cannot mix VHL and low-level commands.

For more details on how to implement VHL, please see our VHL workflow overview.

Definition in file vhl.h.