User's Manual

Elatec GmbH
Page 33 of 44
7.2.5.1.3 Mifare Specific Transponder Operations
byte MifareLogin(byte &Secret, byte KeyType, byte Sector)
In order to do any operations on a sector of a Mifare transponder, a login has to be performed.
Parameters:
byte &Secret Reference to a array of bytes, which has to contain six bytes. These
bytes represent the key for the login process.
byte KeyType Specifies, with which key the operation has to be performed. This is one
of the defined constants KEYA or KEYB.
byte Sector Specifies the sector for the login.
Return: If the operation was successful, the return value is TRUE, otherwise it is
FALSE.
7.2.5.1.4 Legic Specific Operations
byte LegicGeneric(byte &TXData, byte TXCount, byte &RXData,
byte &RXCount, byte MaxRXCount, byte Timeout)
Send a specific command to the built in module of a Legic reader.
Parameters:
byte &TXData Reference to an array of bytes which contains the command to be sent
to the module.
byte TXCount Count of bytes in the specified array of bytes to be sent.
byte &RXData Reference to an array of bytes (receive buffer) which receives the
answer from the module.
byte &RXCount Count of bytes, which have been received.
byte MaxRXCount The size of the receive buffer.
byte Timeout Timeout time in multiples of 100 milliseconds.
Return: If the operation was successful, the return value is TRUE, otherwise it is
FALSE.
Please note, that TXData and RXData do contain a telegram without length byte and LRC or CRC.
This information is calculated by the firmware of the TWN3 reader.