VHL.Setup examples
This page shows example parameter values for VHL.Setup for the most common card types. You need this command when using the VHL & Autoread without config operation mode (or its legacy equivalent). Together with the parameter descriptions in the reference manual, these examples should allow you to parameterize the command for your specific card.
Verify parameters with a static VHL file first
Before coding VHL.Setup calls, we recommend verifying your parameters using a static VHL file in BALTECH ToolSuite. Create a static VHL file and test it — then use the same parameters in your VHL.Setup call.
DESFire
| Parameter | Example value | Notes |
|---|---|---|
| ConsideredCardType | MifareDesfire | |
| DesfireAppId | 0x000001 | 3-byte application ID |
| DesfireFileDesc.FileNo | 0 | File number to access |
| DesfireFileDesc.FileCommunicationSecurity | Encrypted | Or Plain / Mac |
| DesfireFileDesc.FileType | Standard | |
| DesfireFileDesc.ReadKeyNo | 0 | Key index for read; 14 = free access (no authentication) |
| DesfireFileDesc.WriteKeyNo | 0 | Key index for write; 14 = free access (no authentication) |
| DesfireFileDesc.Offset | 0 | Byte offset within the DESFire file where reading starts |
| DesfireFileDesc.Length | 8 | Number of bytes to read from the DESFire file |
| DesfireFileDesc.ReadKeyIdx | (omit) | Reader-side key slot reference; omit to use a key embedded in the command |
| DesfireFileDesc.WriteKeyIdx | (omit) | Reader-side key slot for write; defaults to ReadKeyIdx if omitted |
| DesfireKey | 1 crypto byte + 16 key bytes | First byte selects the algorithm, followed by the key: 0x01 = DES (8 B), 0x02 = 2-key 3DES (16 B), 0x03 = 3-key 3DES (24 B), 0x04 = AES-128 (16 B) |
MIFARE Classic
| Parameter | Example value | Notes |
|---|---|---|
| ConsideredCardType | MifareClassic | |
| MifareKey | FF FF FF FF FF FF | 6-byte key; FF…FF is the factory default transport key |
| MifareAsKeyA | true | true = Key A, false = Key B |
| MifareMadId | (omit) | Optionally filter sectors by 2-byte MAD application ID |
LEGIC
| Parameter | Example value | Notes |
|---|---|---|
| ConsideredCardType | LEGICAdvantIso14443a | Or LEGICPrime / LEGICAdvantIso15693 |
| LegicSegmentInfo | 0x01 | Segment number (1 byte) or stamp bytes |
| LegicEnStamp | false | false = segment number, true = stamp |
| LegicAdrMode | Advant | Advant = application data only; ProtocolHeader = includes stamp header |